Skip to content

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

style check

kristiyanddf2126bd115be
diff --git a/Gruntfile.js b/Gruntfile.js
index e86c9772d..37bbb9196 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -196,29 +196,29 @@ module.exports = function(grunt) {
jsbeautifier : {
files : [
- //'Gruntfile.js',
- //'data/js/**/*.js',
- //'!data/js/settings.default.js',
- //'data/chromium/**/*.js',
- //'data/cordova/**/*.js',
- //'data/ext/editorHTML/*.js',
- //'data/ext/editorJSON/*.js',
- //'data/ext/editorODF/*.js',
- //'data/ext/editorText/*.js',
- //'data/ext/perspectiveGrid/*.js',
- //'data/ext/perspectiveList/*.js',
- //'data/ext/viewerBrowser/*.js',
- //'data/ext/viewerHTML/*.js',
- //'data/ext/viewerImage/*.js',
- //'data/ext/viewerMD/*.js',
- //'data/ext/viewerMHTML/*.js',
- //'data/ext/viewerPDF/*.js',
- //'data/ext/viewerText/*.js',
- //'data/ext/viewerURL/*.js',
- //'data/mozilla/**/*.js',
- //'data/node-webkit/**/*.js',
- //'data/web/**/*.js',
- //'!data/web/webdavlib.js'
+ 'Gruntfile.js',
+ 'data/js/**/*.js',
+ '!data/js/settings.default.js',
+ 'data/chromium/**/*.js',
+ 'data/cordova/**/*.js',
+ 'data/ext/editorHTML/*.js',
+ 'data/ext/editorJSON/*.js',
+ 'data/ext/editorODF/*.js',
+ 'data/ext/editorText/*.js',
+ 'data/ext/perspectiveGrid/*.js',
+ 'data/ext/perspectiveList/*.js',
+ 'data/ext/viewerBrowser/*.js',
+ 'data/ext/viewerHTML/*.js',
+ 'data/ext/viewerImage/*.js',
+ 'data/ext/viewerMD/*.js',
+ 'data/ext/viewerMHTML/*.js',
+ 'data/ext/viewerPDF/*.js',
+ 'data/ext/viewerText/*.js',
+ 'data/ext/viewerURL/*.js',
+ 'data/mozilla/**/*.js',
+ 'data/node-webkit/**/*.js',
+ 'data/web/**/*.js',
+ '!data/web/webdavlib.js'
],
options : {
js: {
diff --git a/data/js/core.api.js b/data/js/core.api.js
index d084a5758..88890a9de 100644
--- a/data/js/core.api.js
+++ b/data/js/core.api.js
@@ -171,13 +171,12 @@ define(function(require, exports, module) {
$(window).on('resize', reLayout);
- changeElement();
+ applyCustomStyles();
}
- function changeElement(e) {
+ function applyCustomStyles() {
var sheet = document.createElement('style');
- sheet.innerHTML = ".tagButton {color: "+ TSCORE.Config.getDefaultTagTextColor()
- +" !important; background: "+ TSCORE.Config.getDefaultTagColor()+" !important;}";
+ sheet.innerHTML = ".tagButton {color: " + TSCORE.Config.getDefaultTagTextColor() + " !important; background: " + TSCORE.Config.getDefaultTagColor() + " !important;}";
document.body.appendChild(sheet);
}
diff --git a/data/js/core.ui.js b/data/js/core.ui.js
index 81b5ca7ad..7902795b5 100644
--- a/data/js/core.ui.js
+++ b/data/js/core.ui.js
@@ -20,10 +20,10 @@ define(function(require, exports) {
var addFileInputName;
var fileDropTemplate = Handlebars.compile(
- '<div id="fileDropArea">' +
- '<div id="fileDropExplanation"><i class="fa fa-2x fa-mail-forward"></i><br>' +
- '<span>Drop files here in order to be copied or moved in the current folder</span></div>' +
- '</div>'
+ '<div id="fileDropArea">' +
+ '<div id="fileDropExplanation"><i class="fa fa-2x fa-mail-forward"></i><br>' +
+ '<span>Drop files here in order to be copied or moved in the current folder</span></div>' +
+ '</div>'
);
function initUI() {
@@ -342,7 +342,7 @@ define(function(require, exports) {
$('a[data-toggle="tab"]').on('shown.bs.tab', function(e) {
var target = $(e.target).attr("href"); // activated tab
if (target === "#dateCalendarTab" || target === "#dateTimeCalendarTab" ||
- target === "dateRangeTab" || target === "#geoLocation") {
+ target === "dateRangeTab" || target === "#geoLocation") {
$('#editTagButton').click(function() {
//$('#newTagName').show();
//TSCORE.TagUtils.renameTag(TSCORE.selectedFiles[0], TSCORE.selectedTag, $('#dateInputCalendar').val());
@@ -615,10 +615,10 @@ define(function(require, exports) {
}
function showFileRenameDialog(filePath) {
- if(!filePath) {
+ if (!filePath) {
filePath = TSCORE.selectedFiles[0];
}
- if(!filePath) {
+ if (!filePath) {
TSCORE.showAlertDialog("Please select a file first.", "Renaming not possible!");
return false;
}
@@ -662,13 +662,13 @@ define(function(require, exports) {
filePath: filePath
}), function() {
TSCORE.IO.deleteFilePromise(filePath).then(function() {
- TSPOSTIO.deleteElement(filePath);
- },
- function(error) {
- TSCORE.hideLoadingAnimation();
- TSCORE.showAlertDialog("Deleting file " + filePath + " failed.");
- console.error("Deleting file " + filePath + " failed " + error);
- }
+ TSPOSTIO.deleteElement(filePath);
+ },
+ function(error) {
+ TSCORE.hideLoadingAnimation();
+ TSCORE.showAlertDialog("Deleting file " + filePath + " failed.");
+ console.error("Deleting file " + filePath + " failed " + error);
+ }
);
});
}
@@ -689,14 +689,14 @@ define(function(require, exports) {
}
TSCORE.showConfirmDialog(
- $.i18n.t('ns.dialogs:fileDeleteTitleConfirm'),
- $.i18n.t(dlgConfirmMsgId, {selectedFiles: selFiles}),
- function() {
- if (TSCORE.IO.stopWatchingDirectories) {
- TSCORE.IO.stopWatchingDirectories();
- }
- TSCORE.IOUtils.deleteFiles(TSCORE.Utils.getUniqueSelectedFiles());
- }
+ $.i18n.t('ns.dialogs:fileDeleteTitleConfirm'),
+ $.i18n.t(dlgConfirmMsgId, {selectedFiles: selFiles}),
+ function() {
+ if (TSCORE.IO.stopWatchingDirectories) {
+ TSCORE.IO.stopWatchingDirectories();
+ }
+ TSCORE.IOUtils.deleteFiles(TSCORE.Utils.getUniqueSelectedFiles());
+ }
);
}
diff --git a/data/js/tags.ui.js b/data/js/tags.ui.js
index 04fb9480f..a2b31ef09 100644
--- a/data/js/tags.ui.js
+++ b/data/js/tags.ui.js
@@ -177,7 +177,7 @@ define(function(require, exports, module) {
$('#createTagGroupButton').on("click", createTagGroup);
$('#editTagGroupButton').click(function() {
- TSCORE.Config.editTagGroup(TSCORE.selectedTagData, $('#tagGroupName').val(), $('#editTagGroupBackgroundColor').val(), $('#editTagGroupForegroundColor').val(),checkColorToAllTags);
+ TSCORE.Config.editTagGroup(TSCORE.selectedTagData, $('#tagGroupName').val(), $('#editTagGroupBackgroundColor').val(), $('#editTagGroupForegroundColor').val(), checkColorToAllTags);
generateTagGroups();
});
}
@@ -207,7 +207,7 @@ define(function(require, exports, module) {
}
function createTagGroup() {
- TSCORE.Config.createTagGroup(TSCORE.selectedTagData, $('#newTagGroupName').val(),$('#tagGroupBackgroundColor').val(),$('#tagGroupForegroundColor').val());
+ TSCORE.Config.createTagGroup(TSCORE.selectedTagData, $('#newTagGroupName').val(), $('#tagGroupBackgroundColor').val(), $('#tagGroupForegroundColor').val());
generateTagGroups();
}
@@ -382,8 +382,7 @@ define(function(require, exports, module) {
var d;
if (tagData.type === 'smart') {
switch (tagData.functionality) {
- case 'geoLocation':
- {
+ case 'geoLocation': {
$('#viewContainers').on('drop dragend', function(event) {
if (TSCORE.selectedTag === 'geoTag') {
tagValue = TSCORE.showTagEditDialog();
@@ -391,27 +390,23 @@ define(function(require, exports, module) {
});
break;
}
- case 'today':
- {
+ case 'today': {
tagValue = TSCORE.TagUtils.formatDateTime4Tag(new Date(), false);
break;
}
- case 'tomorrow':
- {
+ case 'tomorrow': {
d = new Date();
d.setDate(d.getDate() + 1);
tagValue = TSCORE.TagUtils.formatDateTime4Tag(d, false);
break;
}
- case 'yesterday':
- {
+ case 'yesterday': {
d = new Date();
d.setDate(d.getDate() - 1);
tagValue = TSCORE.TagUtils.formatDateTime4Tag(d, false);
break;
}
- case 'currentMonth':
- {
+ case 'currentMonth': {
var cMonth = '' + (new Date().getMonth() + 1);
if (cMonth.length === 1) {
cMonth = '0' + cMonth;
@@ -419,18 +414,15 @@ define(function(require, exports, module) {
tagValue = '' + new Date().getFullYear() + cMonth;
break;
}
- case 'currentYear':
- {
+ case 'currentYear': {
tagValue = '' + new Date().getFullYear();
break;
}
- case 'now':
- {
+ case 'now': {
tagValue = TSCORE.TagUtils.formatDateTime4Tag(new Date(), true);
break;
}
- default:
- {
+ default: {
break;
}
}
@@ -574,7 +566,7 @@ define(function(require, exports, module) {
$editTagGroupForegroundColor.val(TSCORE.selectedTagData.textcolor);
}
- $('#colorChangesToAllTags').on('change', function(){
+ $('#colorChangesToAllTags').on('change', function() {
checkColorToAllTags = $('#colorChangesToAllTags').prop('checked');
});
@@ -661,9 +653,9 @@ define(function(require, exports, module) {
$tagColorChooser.simplecolorpicker({
picker: false
});
- $tagColorChooser.on('change', function() {
- $tagColor.val($tagColorChooser.val());
- });
+ $tagColorChooser.on('change', function() {
+ $tagColor.val($tagColorChooser.val());
+ });
if (TSCORE.selectedTagData.color === undefined || TSCORE.selectedTagData.color.length < 1) {
$tagColor.val(defaultTagColor);
} else {