[TASK] Use strict

This commit is contained in:
Xaver Maierhofer 2016-05-27 23:59:01 +02:00 committed by Milan Paessler
parent 5c15ccf340
commit 9987e443f7
36 changed files with 74 additions and 6 deletions

View file

@ -1,4 +1,6 @@
module.exports = function (grunt) { module.exports = function (grunt) {
"use strict";
grunt.loadTasks("tasks"); grunt.loadTasks("tasks");
grunt.registerTask("default", ["bower-install-simple", "lint", "copy", "sass", "postcss", "requirejs:default", "inline"]); grunt.registerTask("default", ["bower-install-simple", "lint", "copy", "sass", "postcss", "requirejs:default", "inline"]);

2
app.js
View file

@ -1,3 +1,5 @@
"use strict";
require.config({ require.config({
baseUrl: "lib", baseUrl: "lib",
paths: { paths: {

View file

@ -18,7 +18,7 @@
"es6-shim": "~0.35.1", "es6-shim": "~0.35.1",
"almond": "~0.3.2", "almond": "~0.3.2",
"d3": "~3.5.17", "d3": "~3.5.17",
"roboto-fontface": "~0.3.0", "roboto-fontface": "~0.4.5",
"virtual-dom": "~2.1.1", "virtual-dom": "~2.1.1",
"leaflet-providers": "~1.1.10", "leaflet-providers": "~1.1.10",
"rbush": "https://github.com/mourner/rbush.git#~1.4.3" "rbush": "https://github.com/mourner/rbush.git#~1.4.3"

View file

@ -1,4 +1,6 @@
define(function () { define(function () {
"use strict";
return function () { return function () {
this.render = function (d) { this.render = function (d) {
var el = document.createElement("div"); var el = document.createElement("div");

View file

@ -1,4 +1,6 @@
define([], function () { define([], function () {
"use strict";
return function (tag) { return function (tag) {
if (!tag) { if (!tag) {
tag = "div"; tag = "div";

View file

@ -1,4 +1,6 @@
define(["filters/nodefilter"], function (NodeFilter) { define(["filters/nodefilter"], function (NodeFilter) {
"use strict";
return function () { return function () {
var targets = []; var targets = [];
var filterObservers = []; var filterObservers = [];

View file

@ -1,4 +1,6 @@
define([], function () { define(function () {
"use strict";
return function (distributor) { return function (distributor) {
var container = document.createElement("ul"); var container = document.createElement("ul");
container.classList.add("filters"); container.classList.add("filters");

View file

@ -1,4 +1,6 @@
define(["helper"], function (helper) { define(["helper"], function (helper) {
"use strict";
return function (name, key, value, f) { return function (name, key, value, f) {
var negate = false; var negate = false;
var refresh; var refresh;

View file

@ -1,4 +1,6 @@
define([], function () { define(function () {
"use strict";
return function (filter) { return function (filter) {
return function (data) { return function (data) {
var n = Object.create(data); var n = Object.create(data);

View file

@ -1,4 +1,6 @@
define(["d3", "helper"], function (d3, helper) { define(["d3", "helper"], function (d3, helper) {
"use strict";
var margin = 200; var margin = 200;
var NODE_RADIUS = 15; var NODE_RADIUS = 15;
var LINE_RADIUS = 7; var LINE_RADIUS = 7;

View file

@ -5,6 +5,8 @@ define(["chroma-js", "map", "sidebar", "tabs", "container", "meshstats",
function (chroma, Map, Sidebar, Tabs, Container, Meshstats, Legend, Linklist, function (chroma, Map, Sidebar, Tabs, Container, Meshstats, Legend, Linklist,
Nodelist, SimpleNodelist, Infobox, Proportions, ForceGraph, Nodelist, SimpleNodelist, Infobox, Proportions, ForceGraph,
Title, About, DataDistributor, FilterGUI) { Title, About, DataDistributor, FilterGUI) {
"use strict";
return function (config, router) { return function (config, router) {
var self = this; var self = this;
var content; var content;

View file

@ -1,4 +1,6 @@
define(["helper"], function (helper) { define(["helper"], function (helper) {
"use strict";
function showStatImg(o, d) { function showStatImg(o, d) {
var subst = {}; var subst = {};
subst["{SOURCE}"] = d.source.node_id; subst["{SOURCE}"] = d.source.node_id;

View file

@ -1,4 +1,6 @@
define(["helper"], function (helper) { define(["helper"], function (helper) {
"use strict";
return function (config, el, router, d) { return function (config, el, router, d) {
var sidebarTitle = document.createElement("h2"); var sidebarTitle = document.createElement("h2");
sidebarTitle.textContent = "Location: " + d.toString(); sidebarTitle.textContent = "Location: " + d.toString();

View file

@ -1,4 +1,6 @@
define(["infobox/link", "infobox/node", "infobox/location"], function (Link, Node, Location) { define(["infobox/link", "infobox/node", "infobox/location"], function (Link, Node, Location) {
"use strict";
return function (config, sidebar, router) { return function (config, sidebar, router) {
var self = this; var self = this;
var el; var el;

View file

@ -1,5 +1,7 @@
define(["moment", "tablesort", "helper", "moment.de"], define(["moment", "tablesort", "helper", "moment.de"],
function (moment, Tablesort, helper) { function (moment, Tablesort, helper) {
"use strict";
function showGeoURI(d) { function showGeoURI(d) {
function showLatitude(d) { function showLatitude(d) {
var suffix = Math.sign(d) > -1 ? "'N" : "'S"; var suffix = Math.sign(d) > -1 ? "'N" : "'S";

View file

@ -1,4 +1,6 @@
define(function () { define(function () {
"use strict";
return function () { return function () {
var self = this; var self = this;

View file

@ -1,4 +1,6 @@
define(["sorttable", "virtual-dom", "helper"], function (SortTable, V, helper) { define(["sorttable", "virtual-dom", "helper"], function (SortTable, V, helper) {
"use strict";
function linkName(d) { function linkName(d) {
return (d.source.node ? d.source.node.nodeinfo.hostname : d.source.id) + " " + d.target.node.nodeinfo.hostname; return (d.source.node ? d.source.node.nodeinfo.hostname : d.source.id) + " " + d.target.node.nodeinfo.hostname;
} }

View file

@ -1,4 +1,6 @@
define(["leaflet"], function (L) { define(["leaflet"], function (L) {
"use strict";
return L.CircleMarker.extend({ return L.CircleMarker.extend({
outerCircle: { outerCircle: {
stroke: false, stroke: false,

View file

@ -1,5 +1,7 @@
define(["moment", "router", "leaflet", "gui", "helper", "moment.de"], define(["moment", "router", "leaflet", "gui", "helper", "moment.de"],
function (moment, Router, L, GUI, helper) { function (moment, Router, L, GUI, helper) {
"use strict";
return function (config) { return function (config) {
function handleData(data) { function handleData(data) {
var dataNodes = {}; var dataNodes = {};

View file

@ -2,6 +2,8 @@ define(["map/clientlayer", "map/labelslayer",
"d3", "leaflet", "moment", "locationmarker", "rbush", "helper", "d3", "leaflet", "moment", "locationmarker", "rbush", "helper",
"leaflet.label", "leaflet.providers", "moment.de"], "leaflet.label", "leaflet.providers", "moment.de"],
function (ClientLayer, LabelsLayer, d3, L, moment, LocationMarker, rbush, helper) { function (ClientLayer, LabelsLayer, d3, L, moment, LocationMarker, rbush, helper) {
"use strict";
var options = { var options = {
worldCopyJump: true, worldCopyJump: true,
zoomControl: false zoomControl: false

View file

@ -1,5 +1,6 @@
define(["leaflet"], define(["leaflet"],
function (L) { function (L) {
"use strict";
return L.TileLayer.Canvas.extend({ return L.TileLayer.Canvas.extend({
setData: function (d) { setData: function (d) {

View file

@ -1,5 +1,7 @@
define(["leaflet", "rbush"], define(["leaflet", "rbush"],
function (L, rbush) { function (L, rbush) {
"use strict";
var labelLocations = [["left", "middle", 0 / 8], var labelLocations = [["left", "middle", 0 / 8],
["center", "top", 6 / 8], ["center", "top", 6 / 8],
["right", "middle", 4 / 8], ["right", "middle", 4 / 8],

View file

@ -1,4 +1,6 @@
define(["helper"], function (helper) { define(["helper"], function (helper) {
"use strict";
return function (config) { return function (config) {
var self = this; var self = this;
var stats, timestamp; var stats, timestamp;

View file

@ -1,4 +1,6 @@
define(["sorttable", "virtual-dom", "helper"], function (SortTable, V, helper) { define(["sorttable", "virtual-dom", "helper"], function (SortTable, V, helper) {
"use strict";
function getUptime(now, d) { function getUptime(now, d) {
if (d.flags.online && "uptime" in d.statistics) { if (d.flags.online && "uptime" in d.statistics) {
return Math.round(d.statistics.uptime); return Math.round(d.statistics.uptime);

View file

@ -1,5 +1,6 @@
define(["chroma-js", "virtual-dom", "filters/genericnode", "helper"], define(["chroma-js", "virtual-dom", "filters/genericnode", "helper"],
function (Chroma, V, Filter, helper) { function (Chroma, V, Filter, helper) {
"use strict";
return function (config, filterManager) { return function (config, filterManager) {
var self = this; var self = this;

View file

@ -1,4 +1,6 @@
define(["helper"], function (helper) { define(["helper"], function (helper) {
"use strict";
return function () { return function () {
var self = this; var self = this;
var objects = {nodes: {}, links: {}}; var objects = {nodes: {}, links: {}};

View file

@ -1,4 +1,6 @@
define([], function () { define(function () {
"use strict";
return function (el) { return function (el) {
var self = this; var self = this;

View file

@ -1,4 +1,6 @@
define(["moment", "virtual-dom", "helper", "moment.de"], function (moment, V, helper) { define(["moment", "virtual-dom", "helper", "moment.de"], function (moment, V, helper) {
"use strict";
return function (nodes, field, router, title) { return function (nodes, field, router, title) {
var self = this; var self = this;
var el, tbody; var el, tbody;

View file

@ -1,4 +1,6 @@
define(["virtual-dom"], function (V) { define(["virtual-dom"], function (V) {
"use strict";
return function (headings, sortIndex, renderRow) { return function (headings, sortIndex, renderRow) {
var data; var data;
var sortReverse = false; var sortReverse = false;

View file

@ -1,4 +1,6 @@
define([], function () { define(function () {
"use strict";
return function () { return function () {
var self = this; var self = this;

View file

@ -1,4 +1,6 @@
define(function () { define(function () {
"use strict";
return function (config) { return function (config) {
function setTitle(d) { function setTitle(d) {
var title = [config.siteName]; var title = [config.siteName];

View file

@ -1,3 +1,5 @@
"use strict";
define({ define({
get: function (url) { get: function (url) {
return new Promise(function (resolve, reject) { return new Promise(function (resolve, reject) {
@ -77,7 +79,7 @@ define({
}, },
listReplace: function (s, subst) { listReplace: function (s, subst) {
for (key in subst) { for (var key in subst) {
var re = new RegExp(key, "g"); var re = new RegExp(key, "g");
s = s.replace(re, subst[key]); s = s.replace(re, subst[key]);
} }

View file

@ -1,4 +1,6 @@
module.exports = function (grunt) { module.exports = function (grunt) {
"use strict";
grunt.config.merge({ grunt.config.merge({
bowerdir: "bower_components", bowerdir: "bower_components",
copy: { copy: {

View file

@ -1,4 +1,6 @@
module.exports = function (grunt) { module.exports = function (grunt) {
"use strict";
grunt.config.merge({ grunt.config.merge({
clean: { clean: {
build: ["build/**/*", "node_modules/grunt-newer/.cache"] build: ["build/**/*", "node_modules/grunt-newer/.cache"]

View file

@ -1,4 +1,6 @@
module.exports = function (grunt) { module.exports = function (grunt) {
"use strict";
grunt.config.merge({ grunt.config.merge({
connect: { connect: {
server: { server: {

View file

@ -1,4 +1,6 @@
module.exports = function (grunt) { module.exports = function (grunt) {
"use strict";
grunt.config.merge({ grunt.config.merge({
checkDependencies: { checkDependencies: {
options: { options: {