Skip to content

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

js code beautifying

uggrock6c583768c229
diff --git a/data/js/directories.ui.js b/data/js/directories.ui.js
index 84d5fbd96..173366338 100644
--- a/data/js/directories.ui.js
+++ b/data/js/directories.ui.js
@@ -10,7 +10,7 @@ define(function(require, exports, module) {
var dir4ContextMenu = null;
var tsMetadataFolder = '.ts';
var tsMetadataFile = 'tsm.json';
- var alternativeDirectoryNavigatorTmpl = Handlebars.compile(
+ var alternativeDirectoryNavigatorTmpl = Handlebars.compile(
'{{#each dirHistory}}' +
'<div class="btn-group dropup">' +
'<button class="btn btn-link dropdown-toggle" data-menu="{{@index}}">' +
@@ -639,7 +639,7 @@ define(function(require, exports, module) {
});
});
}
-
+
// Public API definition
exports.openLocation = openLocation;
exports.closeCurrentLocation = closeCurrentLocation;
diff --git a/data/js/directorybrowser.js b/data/js/directorybrowser.js
index 66660eb45..695218fad 100644
--- a/data/js/directorybrowser.js
+++ b/data/js/directorybrowser.js
@@ -52,7 +52,7 @@ define(function(require, exports, module) {
show: true
});
}
-
+
// Public Methods
exports.initUI = initUI;
exports.reInitUI = reInitUI;
diff --git a/data/js/options.ui.js b/data/js/options.ui.js
index 07e16db5e..0618fcc80 100644
--- a/data/js/options.ui.js
+++ b/data/js/options.ui.js
@@ -66,11 +66,11 @@ define(function(require, exports, module) {
$('#exportTagGroupsButton').hide();
}
$('#exportTagGroupsButton').click(function() {
- var jsonFormat = '{ "appName": "' + TSCORE.Config.DefaultSettings.appName +
- '", "appVersion": "' + TSCORE.Config.DefaultSettings.appVersion +
- '", "appBuild": "' + TSCORE.Config.DefaultSettings.appBuild +
- '", "settingsVersion": ' + TSCORE.Config.DefaultSettings.settingsVersion +
- ', "tagGroups": ';
+ var jsonFormat = '{ "appName": "' + TSCORE.Config.DefaultSettings.appName +
+ '", "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'
});
@@ -153,7 +153,7 @@ define(function(require, exports, module) {
TSCORE.Config.setReloadDocumentKeyBinding(parseKeyBinding($('#reloadDocumentKeyBinding').val()));
TSCORE.Config.setSaveDocumentKeyBinding(parseKeyBinding($('#saveDocumentKeyBinding').val()));
TSCORE.Config.setPropertiesDocumentKeyBinding(parseKeyBinding($('#documentPropertiesKeyBinding').val()));
-
+
var interfaceLang = $('#languagesList').val();
TSCORE.Config.setInterfaceLangauge(interfaceLang);
TSCORE.switchInterfaceLanguage(interfaceLang);
@@ -188,7 +188,7 @@ define(function(require, exports, module) {
});
return data;
}
-
+
// Public Methods
exports.initUI = initUI;
exports.reInitUI = reInitUI;
diff --git a/data/js/perspective.manager.js b/data/js/perspective.manager.js
index 56306e4aa..3ef563049 100644
--- a/data/js/perspective.manager.js
+++ b/data/js/perspective.manager.js
@@ -169,7 +169,7 @@ define(function(require, exports, module) {
filename = dirList[i].name.replace(/(<([^>]+)>)/gi, ''); // sanitizing filename
path = dirList[i].path.replace(/(<([^>]+)>)/gi, ''); // sanitizing filepath
title = TSCORE.TagUtils.extractTitle(path);
-
+
if (dirList[i].isFile) {
ext = TSCORE.TagUtils.extractFileExtension(path);
tags = TSCORE.TagUtils.extractTags(path);
diff --git a/data/js/postioapi.js b/data/js/postioapi.js
index 1fd3d8c12..e653f5d03 100644
--- a/data/js/postioapi.js
+++ b/data/js/postioapi.js
@@ -3,7 +3,7 @@
* can be found in the LICENSE file. */
define(function(require, exports, module) {
'use strict';
-
+
// Activating browser specific exports modul
console.log('Loading postioapi.js ...');
var TSCORE = require('tscore');
@@ -12,17 +12,17 @@ define(function(require, exports, module) {
TSCORE.PerspectiveManager.updateFileBrowserData(directoryIndex);
TSCORE.hideWaitingDialog();
};
-
+
exports.createDirectoryTree = function(directoyTree) {
TSCORE.PerspectiveManager.updateTreeData(directoyTree);
TSCORE.hideWaitingDialog();
};
-
+
exports.createDirectory = function(dirPath) {
TSCORE.navigateToDirectory(dirPath);
TSCORE.hideWaitingDialog();
};
-
+
exports.copyFile = function(sourceFilePath, targetFilePath) {
var targetDirectory = TSCORE.TagUtils.extractContainingDirectoryPath(targetFilePath);
if (targetDirectory === TSCORE.currentPath) {
@@ -31,7 +31,7 @@ define(function(require, exports, module) {
}
TSCORE.hideWaitingDialog();
};
-
+
exports.renameFile = function(oldFilePath, newFilePath) {
var lastOpenedFile = TSCORE.FileOpener.getOpenedFilePath();
if (lastOpenedFile !== undefined) {
@@ -56,21 +56,21 @@ define(function(require, exports, module) {
}
TSCORE.hideWaitingDialog(); //TSCORE.PerspectiveManager.clearSelectedFiles();
};
-
+
exports.renameDirectory = function(dirOldPath, dirNewPath) {
TSCORE.navigateToDirectory(dirNewPath);
TSCORE.hideLoadingAnimation();
};
-
+
exports.loadTextFile = function(content) {
TSCORE.FileOpener.updateEditorContent(content);
TSCORE.hideLoadingAnimation();
};
-
+
exports.saveBinaryFile = function(filePath) {
TSCORE.PerspectiveManager.refreshFileListContainer();
};
-
+
exports.saveTextFile = function(filePath, isNewFile) {
TSCORE.PerspectiveManager.refreshFileListContainer();
if (isNewFile) {
@@ -79,12 +79,12 @@ define(function(require, exports, module) {
}
TSCORE.FileOpener.setFileChanged(false);
};
-
+
exports.listDirectory = function(anotatedDirList) {
TSCORE.PerspectiveManager.updateFileBrowserData(anotatedDirList);
TSCORE.updateSubDirs(anotatedDirList);
};
-
+
exports.listSubDirectories = function(dirList, dirPath) {
console.log('Listing Subdirs: ' + JSON.stringify(dirList));
TSCORE.subfoldersDirBrowser = dirList;
@@ -92,7 +92,7 @@ define(function(require, exports, module) {
TSCORE.directoryBrowser.reInitUI(dirPath);
}
};
-
+
exports.errorOpeningPath = function(dirPath) {
// Normalazing the paths
var dir1 = TSCORE.TagUtils.cleanTrailingDirSeparator(TSCORE.currentLocationObject.path);
@@ -105,7 +105,7 @@ define(function(require, exports, module) {
TSCORE.showAlertDialog($.i18n.t('ns.dialogs:errorOpeningPathAlert'));
}
};
-
+
exports.deleteElement = function(filePath) {
TSCORE.removeFileModel(TSCORE.fileList, filePath);
TSCORE.PerspectiveManager.removeFileUI(filePath);
@@ -114,22 +114,22 @@ define(function(require, exports, module) {
}
TSCORE.hideLoadingAnimation();
};
-
+
exports.deleteDirectory = function(dirPath) {
TSCORE.navigateToDirectory(TSCORE.TagUtils.extractParentDirectoryPath(dirPath));
TSCORE.hideLoadingAnimation();
};
-
+
exports.deleteDirectoryFailed = function(dirPath) {
console.log('Deleting of \'' + dirPath + '\' failed');
TSCORE.showAlertDialog($.i18n.t('ns.dialogs:errorDeletingDirectoryAlert'));
TSCORE.hideLoadingAnimation();
};
-
+
exports.checkNewVersion = function(data) {
TSCORE.updateNewVersionData(data);
};
-
+
exports.selectDirectory = function(dirPath) {
// TODO make the use of this function more general
if (!TSCORE.TagUtils.stringEndsWith(dirPath, TSCORE.dirSeparator)) {
@@ -141,15 +141,15 @@ define(function(require, exports, module) {
$('#folderLocation2').val(dirPath);
$('#moveCopyDirectoryPath').val(dirPath);
};
-
+
exports.openDirectory = function(dirPath) {};
-
+
exports.selectFile = function() {
console.log('File selected: ' + $(this).val());
};
-
+
exports.openExtensionsDirectory = function() {};
-
+
exports.getFileProperties = function(fileProperties) {
console.log('File properties: ' + JSON.stringify(fileProperties));
TSCORE.FileOpener.setFileProperties(fileProperties);
diff --git a/data/js/search.js b/data/js/search.js
index c2c5fa63f..a11f3ef2d 100644
--- a/data/js/search.js
+++ b/data/js/search.js
@@ -7,21 +7,21 @@ define(function(require, exports, module) {
var TSCORE = require('tscore');
var currentQuery = '';
var nextQuery = '';
-
+
var search4Tag = function(tagQuery) {
TSCORE.Search.nextQuery = '+' + tagQuery;
$('#searchBox').val('+' + tagQuery);
TSCORE.PerspectiveManager.redrawCurrentPerspective();
TSCORE.showSearchArea();
};
-
+
var search4String = function(query) {
TSCORE.Search.nextQuery = '+' + query;
$('#searchBox').val('+' + query);
TSCORE.PerspectiveManager.redrawCurrentPerspective();
TSCORE.showSearchArea();
};
-
+
var calculateTags = function(data) {
console.log('Calculating tags from search results');
var allTags = [];
@@ -43,7 +43,7 @@ define(function(require, exports, module) {
});
TSCORE.generateTagGroups();
};
-
+
var searchData = function(data, query) {
query = query.toLowerCase().replace(/^\s+|\s+$/g, '');
if (query.indexOf('?') === 0) {
@@ -139,11 +139,11 @@ define(function(require, exports, module) {
}
return data;
};
-
+
// Public variables definition
exports.currentQuery = currentQuery;
exports.nextQuery = nextQuery;
-
+
// Public API definition
exports.searchData = searchData;
exports.searchForTag = search4Tag;
diff --git a/data/js/settings.api.js b/data/js/settings.api.js
index 7cb12ed0f..9580bf409 100644
--- a/data/js/settings.api.js
+++ b/data/js/settings.api.js
@@ -577,7 +577,7 @@ define(function(require, exports, module) {
if (exports.Settings.tagGroups[i].children[j].title === tagName) {
return exports.Settings.tagGroups[i].children[j];
}
- }
+ }
}
return false;
};
@@ -945,23 +945,23 @@ define(function(require, exports, module) {
exports.getShowTagLibraryKeyBinding = getShowTagLibraryKeyBinding;
exports.setShowFolderNavigatorKeyBinding = setShowFolderNavigatorKeyBinding;
exports.getShowFolderNavigatorBinding = getShowFolderNavigatorBinding;
-
+
exports.getPerspectiveExtensions = getPerspectiveExtensions;
exports.getActivatedPerspectiveExtensions = getActivatedPerspectiveExtensions;
exports.getViewerExtensions = getViewerExtensions;
exports.getEditorExtensions = getEditorExtensions;
-
+
exports.getNewTextFileContent = getNewTextFileContent;
exports.getNewHTMLFileContent = getNewHTMLFileContent;
exports.getNewMDFileContent = getNewMDFileContent;
exports.getFileTypeEditor = getFileTypeEditor;
exports.getFileTypeViewer = getFileTypeViewer;
exports.getAllTags = getAllTags;
-
+
exports.getTagData = getTagData;
exports.getTagGroupData = getTagGroupData;
exports.getAllTagGroupData = getAllTagGroupData;
-
+
exports.deleteTag = deleteTag;
exports.deleteTagGroup = deleteTagGroup;
exports.editTag = editTag;
diff --git a/data/js/tags.ui.js b/data/js/tags.ui.js
index 3fa4d405e..6d718d987 100644
--- a/data/js/tags.ui.js
+++ b/data/js/tags.ui.js
@@ -276,7 +276,7 @@ define(function(require, exports, module) {
var d;
if (tagData.type === 'smart') {
switch (tagData.functionality) {
- case 'here': {
+ case 'here': {
/* window.onload = function() {
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(function(position) {
@@ -504,11 +504,11 @@ define(function(require, exports, module) {
show: true
});
}
-
+
// Public Vars
exports.calculatedTags = [];
exports.locationTags = [];
-
+
// Public API definition
exports.initUI = initUI;
exports.generateTagGroups = generateTagGroups;
diff --git a/data/js/tagutils.js b/data/js/tagutils.js
index c674aaa9c..66746be3d 100644
--- a/data/js/tagutils.js
+++ b/data/js/tagutils.js
@@ -292,7 +292,7 @@ define(function(require, exports, module) {
}
return cleanedTags;
}
-
+
// Internal
function generateFileName(fileName, tags) {
var tagsString = '';
@@ -428,7 +428,7 @@ define(function(require, exports, module) {
var newFileName = generateFileName(fileName, extractedTags);
TSCORE.IO.renameFile(filePath, containingDirectoryPath + TSCORE.dirSeparator + newFileName);
}
-
+
// Replaces a tag with a new one
function renameTag(filePath, oldTag, newTag) {
console.log('Rename tag for file: ' + filePath);
@@ -458,7 +458,7 @@ define(function(require, exports, module) {
TSCORE.IO.renameFile(filePath, containingDirectoryPath + TSCORE.dirSeparator + newFileName + fileExt);
return true;
}
-
+
// Removing a tag from a filename
function removeTag(filePath, tagName) {
console.log('Removing tag: ' + tagName + ' from ' + filePath);
@@ -474,7 +474,7 @@ define(function(require, exports, module) {
var newFileName = generateFileName(fileName, newTags);
TSCORE.IO.renameFile(filePath, containingDirectoryPath + TSCORE.dirSeparator + newFileName);
}
-
+
// Public API definition
exports.beginTagContainer = BEGIN_TAG_CONTAINER;
exports.endTagContainer = END_TAG_CONTAINER;