Skip to content

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

jshinting

uggrock7daebd0a7d49
diff --git a/data/chrome/background.js b/data/chrome/background.js
index e65adf084..635c95483 100644
--- a/data/chrome/background.js
+++ b/data/chrome/background.js
@@ -1,6 +1,8 @@
/* Copyright (c) 2012-2013 The TagSpaces Authors. All rights reserved.
* Use of this source code is governed by a AGPL3 license that
* can be found in the LICENSE file. */
+"use strict";
+
chrome.browserAction.onClicked.addListener(function() {
chrome.tabs.create({
url: 'index.html'
diff --git a/data/chromelight/captureContent.js b/data/chromelight/captureContent.js
index 536cf489d..f239f1e93 100644
--- a/data/chromelight/captureContent.js
+++ b/data/chromelight/captureContent.js
@@ -1,3 +1,5 @@
+"use strict";
+
function DOMtoString(document_root) {
var html = '',
node = document_root.firstChild;
diff --git a/data/chromelight/chrome.api.js b/data/chromelight/chrome.api.js
index c3e581662..4954b46b3 100644
--- a/data/chromelight/chrome.api.js
+++ b/data/chromelight/chrome.api.js
@@ -303,7 +303,7 @@ define(function(require, exports, module) {
console.log("Select directory!");
var rootPath = "/";
if (isWin) {
- rootPath = "C:"
+ rootPath = "C:";
}
TSCORE.showDirectoryBrowserDialog(rootPath);
};
diff --git a/data/chromelight/popup.js b/data/chromelight/popup.js
index 82c7c6bd4..219bab7e8 100644
--- a/data/chromelight/popup.js
+++ b/data/chromelight/popup.js
@@ -1,6 +1,7 @@
/* Copyright (c) 2012-2014 The TagSpaces Authors. All rights reserved.
* Use of this source code is governed by a AGPL3 license that
* can be found in the LICENSE file. */
+/* global saveAs, DOMPurify */
'use strict';
@@ -161,7 +162,7 @@
// end saving all images*/
cleanedHTML = "<body>" + cleanedHTML + "</body>";
- cleanedHTML = htmlTemplate.replace(/\<body[^>]*\>([^]*)\<\/body>/m, cleanedHTML);
+ cleanedHTML = htmlTemplate.replace(/\<body[^>]*\>([^]*)\<\/body>/m, cleanedHTML); // jshint ignore:line
return cleanedHTML;
}
diff --git a/data/cordova/cordova.api.js b/data/cordova/cordova.api.js
index 686eb9dde..bd850af79 100644
--- a/data/cordova/cordova.api.js
+++ b/data/cordova/cordova.api.js
@@ -14,7 +14,7 @@ define(function(require, exports, module) {
var attachFastClick = require('cordova/fastclick/fastclick.min');
attachFastClick(document.body);
- var fsRoot = undefined;
+ var fsRoot;
var urlFromIntent;
@@ -125,7 +125,7 @@ define(function(require, exports, module) {
for (i = 0; i < entries.length; i++) {
if (entries[i].isFile) {
console.log("File: " + entries[i].name);
- tree["children"].push({
+ tree.children.push({
"name": entries[i].name,
"isFile": entries[i].isFile,
"size": "", // TODO size and lmtd
@@ -149,7 +149,7 @@ define(function(require, exports, module) {
}
}
- var anotatedTree = undefined;
+ var anotatedTree;
var pendingCallbacks = 0;
var createDirectoryTree = function(dirPath) {
console.log("Creating directory index for: " + dirPath);
@@ -425,7 +425,7 @@ define(function(require, exports, module) {
saveFile(isFileNew);
},
function() {
- saveFile(isFileNew)
+ saveFile(isFileNew);
}
);
diff --git a/data/mozilla/firefoxos.api.js b/data/mozilla/firefoxos.api.js
index 7587df478..26aa830e8 100644
--- a/data/mozilla/firefoxos.api.js
+++ b/data/mozilla/firefoxos.api.js
@@ -61,7 +61,7 @@ define(function(require, exports, module) {
// Handling the UTF8 support for text files
var UTF8_BOM = "\ufeff";
- if (content.indexOf(UTF8_BOM) == 0) {
+ if (content.indexOf(UTF8_BOM) === 0) {
// already has a UTF8 bom
} else {
content = UTF8_BOM + content;
@@ -88,7 +88,7 @@ define(function(require, exports, module) {
cursor.onsuccess = function() {
console.log("Listing storage success!");
var file = this.result;
- if (file != null) {
+ if (file !== null) {
//var imageElement = $('<img height="100" width="75">');
//imageElement.attr('src', window.URL.createObjectURL(file));
//$("<p>" + file.name + "," + file.lastModifiedDate + "," + file.type + "," + file.size + "</p>").appendTo('#results');
@@ -147,7 +147,7 @@ define(function(require, exports, module) {
var checkNewVersion = function() {
console.log("Checking for new version...");
- var cVer = TSCORE.Config.DefaultSettings["appVersion"] + "." + TSCORE.Config.DefaultSettings["appBuild"];
+ var cVer = TSCORE.Config.DefaultSettings.appVersion + "." + TSCORE.Config.DefaultSettings.appBuild;
$.ajax({
url: 'http://tagspaces.org/releases/version.json?nVer=' + cVer,
type: 'GET',
diff --git a/data/mozilla/ioutils.js b/data/mozilla/ioutils.js
index 86f5de500..9d083705d 100644
--- a/data/mozilla/ioutils.js
+++ b/data/mozilla/ioutils.js
@@ -102,11 +102,11 @@ function directoryTree(dirPath) {
var dirList = filesIO.list(dirPath);
var directory = Cc['@mozilla.org/file/local;1'].createInstance(Ci.nsIFile);
directory.initWithPath(dirPath);
- tree["name"] = directory.leafName;
- tree["isFile"] = false;
- tree["lmdt"] = directory.lastModifiedTime;
- tree["path"] = dirPath;
- tree["children"] = [];
+ tree.name = directory.leafName;
+ tree.isFile = false;
+ tree.lmdt = directory.lastModifiedTime;
+ tree.path = dirPath;
+ tree.children = [];
for (var i = 0; i < dirList.length; i++) {
try {
@@ -114,7 +114,7 @@ function directoryTree(dirPath) {
var file = Cc['@mozilla.org/file/local;1'].createInstance(Ci.nsIFile);
file.initWithPath(path);
if (file.isFile()) {
- tree["children"].push({
+ tree.children.push({
"name": file.leafName,
"isFile": true,
"size": file.fileSize,
@@ -122,7 +122,7 @@ function directoryTree(dirPath) {
"path": path
});
} else {
- tree["children"].push(directoryTree(path));
+ tree.children.push(directoryTree(path));
}
} catch (ex) {
console.error("Filepath has a invalid encoding " + ex);
@@ -457,7 +457,7 @@ exports.saveBinaryFile = function saveBinaryFile(filePath, content, worker) {
file.create(0, 0664);
}
var out = Cc["@mozilla.org/network/file-output-stream;1"].createInstance(Ci.nsIFileOutputStream);
- out.init(file, 0x20 | 0x02, 00004, null);
+ out.init(file, 0x20 | 0x02, 00004, null); // jshint ignore:line
out.write(content, content.length);
out.flush();
out.close();