Skip to content

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

Enable/disable meta data use in pro version

Borislav Sapundzhiev773fd03c33c4
diff --git a/data/ext/perspectiveGrid/perspectiveUI.js b/data/ext/perspectiveGrid/perspectiveUI.js
index 8a4ea12f8..33407b2f6 100644
--- a/data/ext/perspectiveGrid/perspectiveUI.js
+++ b/data/ext/perspectiveGrid/perspectiveUI.js
@@ -8,17 +8,16 @@ define(function(require, exports, module) {
console.log("Loading UI for perspectiveDefault");
var TSCORE = require("tscore");
- var TSPRO = require("tspro");
var TMB_SIZES = ["200px", "300px", "100px"];
var MONTH = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
- var supportedFileTypeThumnailing = [
+ /*var supportedFileTypeThumnailing = [
"jpg", "jpeg", "png", "gif", "pdf", "svg", "webp", "bmp",
"zip", "epub", "docx", "pptx", "pptm", "potx", "potm",
"ppxs", "ppsm", "sldx", "sldm", "dotx", "dotm", "xlsx",
"xlsm", "xlst", "odp", "odg", "ods", "odt"
- ];
+ ];*/
function ExtUI(extID) {
this.extensionID = extID;
diff --git a/data/js/directories.ui.js b/data/js/directories.ui.js
index be5c7c25c..a028acf63 100644
--- a/data/js/directories.ui.js
+++ b/data/js/directories.ui.js
@@ -8,7 +8,6 @@ define(function(require, exports, module) {
console.log('Loading directories.ui.js ...');
var TSCORE = require('tscore');
- var TSPRO = require('tspro');
var directoryHistory = [];
var dir4ContextMenu = null;
var alternativeDirectoryNavigatorTmpl = Handlebars.compile(
@@ -367,12 +366,16 @@ define(function(require, exports, module) {
}
console.log('Dir History: ' + JSON.stringify(directoryHistory));
TSCORE.currentPath = directoryPath;
- TSCORE.Meta.getDirectoryMetaInformation(function() {
+
+ if (TSCORE.PRO && TSCORE.Config.getEnableMetaData()) {
+ TSCORE.Meta.getDirectoryMetaInformation(function() {
+ TSCORE.IO.listDirectory(directoryPath);
+ TSCORE.IO.createMetaFolder(directoryPath);
+ });
+ } else {
TSCORE.IO.listDirectory(directoryPath);
- if (TSCORE.IO.createMetaFolder && TSCORE.PRO) {
- TSCORE.IO.createMetaFolder(directoryPath);
- }
- });
+ }
+
}
function initUI() {
diff --git a/data/js/options.ui.js b/data/js/options.ui.js
index f9747ccdb..76fe9a7f0 100644
--- a/data/js/options.ui.js
+++ b/data/js/options.ui.js
@@ -55,6 +55,19 @@ define(function(require, exports, module) {
parent.prepend(fileTypeControl);
}
+ function enableMetaData()
+ {
+ if (!TSCORE.PRO) {
+ return;
+ }
+ var isMetaEnabled = $('#enableMetaData').is(':checked');
+ if (!isMetaEnabled) {
+ $('#writeMetaToSidecarFile').attr('checked', false);
+ TSCORE.Config.setWriteMetaToSidecarFile(false);
+ }
+ $('#writeMetaToSidecarFile').attr('disabled', !isMetaEnabled);
+ }
+
function initUI() {
$('#addFileTypeButton').click(function(e) {
// Fixes reloading of the application by click
@@ -100,6 +113,10 @@ define(function(require, exports, module) {
saveAs(blob, 'tsm[' + TSCORE.TagUtils.formatDateTime4Tag(new Date(), true) + '].json');
console.log('Group Data Saved...');
});
+
+ $('#enableMetaData').change(function() {
+ enableMetaData();
+ });
}
function reInitUI() {
@@ -123,6 +140,8 @@ define(function(require, exports, module) {
$('#perspectiveList').empty();
$('#writeMetaToSidecarFile').attr('checked', TSCORE.Config.getWriteMetaToSidecarFile());
$('#useDefaultLocationCheckbox').attr('checked', TSCORE.Config.getUseDefaultLocation());
+ $('#enableMetaData').attr('checked', TSCORE.Config.getEnableMetaData());
+ enableMetaData();
TSCORE.Config.getPerspectives().forEach(function(value) {
addPerspective($('#perspectiveList'), value.id);
});
@@ -182,6 +201,7 @@ define(function(require, exports, module) {
TSCORE.Config.setSaveDocumentKeyBinding(parseKeyBinding($('#saveDocumentKeyBinding').val()));
TSCORE.Config.setPropertiesDocumentKeyBinding(parseKeyBinding($('#documentPropertiesKeyBinding').val()));
TSCORE.Config.setSearchKeyBinding(parseKeyBinding($('#showSearchKeyBinding').val()));
+ TSCORE.Config.setEnableMetaData($('#enableMetaData').is(':checked'));
var interfaceLang = $('#languagesList').val();
TSCORE.Config.setInterfaceLangauge(interfaceLang);
TSCORE.switchInterfaceLanguage(interfaceLang);
diff --git a/data/js/perspective.manager.js b/data/js/perspective.manager.js
index 67da4b4c4..745f9cb04 100644
--- a/data/js/perspective.manager.js
+++ b/data/js/perspective.manager.js
@@ -6,8 +6,7 @@ define(function(require, exports, module) {
console.log('Loading perspective.manager.js ...');
var perspectives;
var TSCORE = require('tscore');
- var TSPRO = require("tspro");
-
+
function initPerspective(extPath) {
return new Promise(function(resolve, reject) {
require([extPath], function(perspective) {
diff --git a/data/js/settings.api.js b/data/js/settings.api.js
index fd79375fe..126b224ee 100644
--- a/data/js/settings.api.js
+++ b/data/js/settings.api.js
@@ -605,6 +605,15 @@ define(function(require, exports, module) {
var setLoadLocationMeta = function(value) {
exports.Settings.loadLocationMeta = value;
};
+ var getEnableMetaData = function() {
+ if (exports.Settings.enableMetaData === undefined) {
+ exports.Settings.enableMetaData = exports.DefaultSettings.enableMetaData;
+ }
+ return exports.Settings.enableMetaData;
+ };
+ var setEnableMetaData = function(value) {
+ exports.Settings.enableMetaData = value;
+ };
var getSupportedFileTypes = function() {
if (exports.Settings.supportedFileTypes === undefined) {
exports.Settings.supportedFileTypes = exports.DefaultSettings.supportedFileTypes;
@@ -1015,6 +1024,8 @@ define(function(require, exports, module) {
exports.setCalculateTags = setCalculateTags;
exports.getLoadLocationMeta = getLoadLocationMeta;
exports.setLoadLocationMeta = setLoadLocationMeta;
+ exports.setEnableMetaData = setEnableMetaData;
+ exports.getEnableMetaData = getEnableMetaData;
exports.getIsWindowMaximized = getIsWindowMaximized;
exports.setIsWindowMaximized = setIsWindowMaximized;
exports.getLastOpenedLocation = getLastOpenedLocation;
diff --git a/data/loader.js b/data/loader.js
index 518439520..e8980ec3c 100644
--- a/data/loader.js
+++ b/data/loader.js
@@ -56,7 +56,7 @@ if( isFirefox ) {
}
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'; }
console.log("Loading Loader - Firefox: "+isFirefox+" | ChromeExt: "+isChrome+" | Node: "+isNode+" | Cordova: "+isCordova+" | Web: "+isWeb+" | isWin: "+isWin);
diff --git a/data/templates/OptionsDialog.html b/data/templates/OptionsDialog.html
index b68d633f8..c11d43dc6 100644
--- a/data/templates/OptionsDialog.html
+++ b/data/templates/OptionsDialog.html
@@ -69,6 +69,14 @@
</div>
{{#if isProVersion}}
<div class="tab-pane active" id="pro" style="overflow-y: auto; overflow-x: hidden;">
+ <div class="form-group">
+ <div class="col-sm-12 checkbox">
+ <label for="enableMetaData" >
+ <input type="checkbox" id="enableMetaData" />
+ <span>Enable the use of a hidden meta directory, for storing meta information and thumbnails</span>
+ </label>
+ </div>
+ </div>
<div class="form-group">
<div class="col-sm-12 checkbox">
<label for="writeMetaToSidecarFile" >