GUI: Added ESLint to gulp tasks. ONOS-6521
Commented out gulp tasks making this change uneffective
Fixed an error in the build script
Change-Id: I4f4f9762aa1a66304aa74b3ab208095b9c1d4515
diff --git a/web/gui/src/main/webapp/app/fw/svg/geodata.js b/web/gui/src/main/webapp/app/fw/svg/geodata.js
index 31bef50..5270e00 100644
--- a/web/gui/src/main/webapp/app/fw/svg/geodata.js
+++ b/web/gui/src/main/webapp/app/fw/svg/geodata.js
@@ -93,7 +93,7 @@
promise.meta = {
id: id,
url: url,
- wasCached: false
+ wasCached: false,
};
promise.then(function (response) {
@@ -118,7 +118,7 @@
objectTag: 'states',
projection: d3.geo.mercator(),
logicalSize: 1000,
- mapFillScale: .95
+ mapFillScale: .95,
};
// converts given TopoJSON-format data into corresponding GeoJSON
@@ -138,7 +138,7 @@
return {
geodata: geoData,
pathgen: path,
- settings: settings
+ settings: settings,
};
}
@@ -181,7 +181,7 @@
clearCache: clearCache,
fetchTopoData: fetchTopoData,
createPathGenerator: createPathGenerator,
- rescaleProjection: rescaleProjection
+ rescaleProjection: rescaleProjection,
};
}]);
-}());
\ No newline at end of file
+}());
diff --git a/web/gui/src/main/webapp/app/fw/svg/glyph.js b/web/gui/src/main/webapp/app/fw/svg/glyph.js
index e029f12..a333929 100644
--- a/web/gui/src/main/webapp/app/fw/svg/glyph.js
+++ b/web/gui/src/main/webapp/app/fw/svg/glyph.js
@@ -29,8 +29,8 @@
// constants
var msgGS = 'GlyphService.',
- rg = "registerGlyphs(): ",
- rgs = "registerGlyphSet(): ";
+ rg = 'registerGlyphs(): ',
+ rgs = 'registerGlyphSet(): ';
// ----------------------------------------------------------------------
@@ -42,7 +42,7 @@
if (!overwrite && glyphs.get(key)) {
dups.push(key);
} else {
- glyphs.set(key, {id: key, vb: vbox, d: value});
+ glyphs.set(key, { id: key, vb: vbox, d: value });
}
}
@@ -166,7 +166,7 @@
width: sz,
height: sz,
'class': 'glyph',
- 'xlink:href': '#' + glyphId
+ 'xlink:href': '#' + glyphId,
};
if (xns) {
@@ -196,7 +196,7 @@
glyph: glyph,
glyphDefined: glyphDefined,
loadDefs: loadDefs,
- addGlyph: addGlyph
+ addGlyph: addGlyph,
};
return api;
}]
diff --git a/web/gui/src/main/webapp/app/fw/svg/glyphData.js b/web/gui/src/main/webapp/app/fw/svg/glyphData.js
index 3c80974..4d2cfbc 100644
--- a/web/gui/src/main/webapp/app/fw/svg/glyphData.js
+++ b/web/gui/src/main/webapp/app/fw/svg/glyphData.js
@@ -60,7 +60,7 @@
'm-0.6,7.4a21.3,21.3,0,0,0,5.9,11.7l5.7,5.7' +
'c3,3,9,4.1,11.9,1.3-3.3.9-5.9-1.2-7.9-3.2L34.3,88.1Z' +
'm3.5-12.4a16.6,16.6,0,0,0-2.3,3.6L57,100.8' +
- 'c3,3,9,4.1,11.9,1.3-3.3.9-5.9-1.2-7.9-3.2Z'
+ 'c3,3,9,4.1,11.9,1.3-3.3.9-5.9-1.2-7.9-3.2Z',
},
@@ -521,7 +521,7 @@
'L22,23.7z M97.9,46.5H77.2L88,23.7L97.9,46.5z',
xClose: 'M20,8l35,35,35-35,12,12-35,35,35,35-12,12-35-35-35,35' +
- '-12-12,35-35-35-35,12-12Z'
+ '-12-12,35-35-35-35,12-12Z',
},
badgeDataSet = {
@@ -545,7 +545,7 @@
play: 'M3,1.5l3.5,3.5l-3.5,3.5z',
- stop: 'M2.5,2.5h5v5h-5z'
+ stop: 'M2.5,2.5h5v5h-5z',
},
spriteData = {
@@ -560,7 +560,7 @@
'M93.6,74.7c10.2-2,10.7-14,5.8-18.3' +
'M71.1,79.3c11.2,7.6,24.6,6.4,22.1-11.7' +
'M36.4,76.8c3.4,13.3,35.4,11.6,36.1-1.4' +
- 'M70.4,31c11.8-10.4,26.2-5.2,24.7,10.1'
+ 'M70.4,31c11.8-10.4,26.2-5.2,24.7,10.1',
},
@@ -1282,7 +1282,7 @@
'M81.7,80.8H17.9a1.8,1.8,0,0,1-1.6-2.7l9.2-16.8' +
'a1.8,1.8,0,0,1,1.6-1h9.5a1.8,1.8,0,1,1,0,3.7H28.2L21,77.1H78.6' +
'L71.4,64H61.9a1.8,1.8,0,1,1,0-3.7H72.5a1.8,1.8,0,0,1,1.6,1' +
- 'l9.2,16.8A1.8,1.8,0,0,1,81.7,80.8Z'
+ 'l9.2,16.8A1.8,1.8,0,0,1,81.7,80.8Z',
},
extraGlyphs = {
@@ -1295,7 +1295,7 @@
'a175.5,175.5,0,0,0,58.6-10l3.9-1.4,3.9-1.5,3.9-1.7h0' +
'l3.9-1.7,2.8-1.3,2.7-1.4a175.6,175.6,0,0,0,95.9-155.1' +
'C372.4,226.7,358,290.1,286.5,289.9ZM110.1,237.7' +
- 'A33.6,33.6,0,1,1,143.7,204,33.6,33.6,0,0,1,110.1,237.7Z'
+ 'A33.6,33.6,0,1,1,143.7,204,33.6,33.6,0,0,1,110.1,237.7Z',
};
@@ -1317,7 +1317,7 @@
.factory('GlyphDataService',
[function () {
return {
- registerCoreGlyphs: registerCoreGlyphs
+ registerCoreGlyphs: registerCoreGlyphs,
};
}]
);
diff --git a/web/gui/src/main/webapp/app/fw/svg/icon.js b/web/gui/src/main/webapp/app/fw/svg/icon.js
index 67a557b..aabbc17 100644
--- a/web/gui/src/main/webapp/app/fw/svg/icon.js
+++ b/web/gui/src/main/webapp/app/fw/svg/icon.js
@@ -20,7 +20,7 @@
(function () {
'use strict';
- var $log, fs, gs, sus;
+ var $log, gs, sus;
var vboxSize = 50,
cornerSize = vboxSize / 10,
@@ -39,7 +39,6 @@
delta: 'delta',
nonzero: 'nonzero',
-
close: 'xClose',
topo: 'topo',
@@ -79,8 +78,8 @@
nav_links: 'ports',
nav_hosts: 'endstation',
nav_intents: 'relatedIntents',
- nav_tunnels: 'ports', // TODO: use tunnel glyph, when available
- nav_yang: 'yang'
+ nav_tunnels: 'ports', // TODO: use tunnel glyph, when available
+ nav_yang: 'yang',
};
function ensureIconLibDefs() {
@@ -115,24 +114,24 @@
'class': svgCls,
width: dim,
height: dim,
- viewBox: viewBox
+ viewBox: viewBox,
});
g = svg.append('g').attr({
- 'class': 'icon'
+ 'class': 'icon',
});
g.append('rect').attr({
width: vboxSize,
height: vboxSize,
- rx: cornerSize
+ rx: cornerSize,
});
g.append('use').attr({
width: vboxSize,
height: vboxSize,
'class': 'glyph',
- 'xlink:href': '#' + gid
+ 'xlink:href': '#' + gid,
});
}
@@ -159,7 +158,7 @@
return elem.append('use').attr({
'xlink:href': '#' + gid,
width: iconDim,
- height: iconDim
+ height: iconDim,
});
}
@@ -175,7 +174,7 @@
'xlink:href': '#' + glyphId,
width: dim,
height: dim,
- transform: sus.translate(xlate,xlate)
+ transform: sus.translate(xlate, xlate),
});
return g;
}
@@ -190,7 +189,7 @@
return {
asc: function (div) { _s(div, 'upArrow'); },
desc: function (div) { _s(div, 'downArrow'); },
- none: function (div) { div.remove(); }
+ none: function (div) { div.remove(); },
};
}
@@ -218,16 +217,15 @@
div.selectAll('*').remove();
is.loadEmbeddedIcon(div, attrs.iconId, attrs.iconSize);
});
- }
+ },
};
}])
- .factory('IconService', ['$log', 'FnService', 'GlyphService',
+ .factory('IconService', ['$log', 'GlyphService',
'SvgUtilService',
- function (_$log_, _fs_, _gs_, _sus_) {
+ function (_$log_, _gs_, _sus_) {
$log = _$log_;
- fs = _fs_;
gs = _gs_;
sus = _sus_;
@@ -238,7 +236,7 @@
addDeviceIcon: addDeviceIcon,
addHostIcon: addHostIcon,
sortIcons: sortIcons,
- registerIconMapping: registerIconMapping
+ registerIconMapping: registerIconMapping,
};
}]);
diff --git a/web/gui/src/main/webapp/app/fw/svg/map.js b/web/gui/src/main/webapp/app/fw/svg/map.js
index ea67428..3d79d64 100644
--- a/web/gui/src/main/webapp/app/fw/svg/map.js
+++ b/web/gui/src/main/webapp/app/fw/svg/map.js
@@ -35,7 +35,7 @@
'use strict';
// injected references
- var $log, $q, fs, gds;
+ var $log, $q, gds;
// NOTE: This method assumes the datafile has exactly the map data
// that you want to load; for example id="*continental_us"
@@ -87,7 +87,7 @@
// });
function loadMapRegionInto(mapLayer, opts) {
- var promise = gds.fetchTopoData("*countries"),
+ var promise = gds.fetchTopoData('*countries'),
deferredProjection = $q.defer();
if (!promise) {
@@ -105,7 +105,7 @@
country = features.filter(opts.countryFilter),
countryFeature = {
type: 'FeatureCollection',
- features: country
+ features: country,
},
path = d3.geo.path().projection(proj);
@@ -137,7 +137,7 @@
svg.style('background-color', bg);
paths.attr({
stroke: stroke,
- fill: fill
+ fill: fill,
});
} else {
svg.style('background-color', null);
@@ -145,17 +145,16 @@
}
angular.module('onosSvg')
- .factory('MapService', ['$log', '$q', 'FnService', 'GeoDataService',
- function (_$log_, _$q_, _fs_, _gds_) {
+ .factory('MapService', ['$log', '$q', 'GeoDataService',
+ function (_$log_, _$q_, _gds_) {
$log = _$log_;
$q = _$q_;
- fs = _fs_;
gds = _gds_;
return {
loadMapRegionInto: loadMapRegionInto,
loadMapInto: loadMapInto,
- reshade: reshade
+ reshade: reshade,
};
}]);
diff --git a/web/gui/src/main/webapp/app/fw/svg/sprite.js b/web/gui/src/main/webapp/app/fw/svg/sprite.js
index 3d088e1..edf1839 100644
--- a/web/gui/src/main/webapp/app/fw/svg/sprite.js
+++ b/web/gui/src/main/webapp/app/fw/svg/sprite.js
@@ -32,30 +32,30 @@
},
addRect: {
fill: 'gray1',
- stroke: 'none'
+ stroke: 'none',
},
addPath: {
fill: 'none',
- stroke: 'gray1'
- }
+ stroke: 'gray1',
+ },
},
layout: {
builder: {
- grid: 10 // grid square size (in layout coord-space)
+ grid: 10, // grid square size (in layout coord-space)
},
addSprite: {
- anchor: 'topleft' // topleft, center
+ anchor: 'topleft', // topleft, center
},
addLabel: {
- anchor: 'center', // center, left, right
- fontStyle: 'normal' // normal, italic, bold
- }
- }
+ anchor: 'center', // center, left, right
+ fontStyle: 'normal', // normal, italic, bold
+ },
+ },
};
// internal state
- var sprites, // sprite cache
- layouts, // layout cache
+ var sprites, // sprite cache
+ layouts, // layout cache
api;
// ----------------------------------------------------------------------
@@ -81,7 +81,7 @@
var o = angular.extend({}, optDefaults.sprite.addRect, opts);
rects.push({
- x: x, y: y, w: w, h: h, o: o
+ x: x, y: y, w: w, h: h, o: o,
});
return builder;
}
@@ -90,9 +90,9 @@
var o = angular.extend({}, optDefaults.sprite.addPath, opts);
if (fs.isS(d)) {
- paths.push({d: d, o: o});
+ paths.push({ d: d, o: o });
} else if (fs.isA(d)) {
- paths.push({d: d.join(''), o: o});
+ paths.push({ d: d.join(''), o: o });
} else {
$log.warn('addPath: path not a string or array', d);
}
@@ -110,7 +110,7 @@
id: id,
w: w,
h: h,
- opts: o
+ opts: o,
},
paths: paths,
rects: rects,
@@ -118,7 +118,7 @@
// builder API
addRect: addRect,
addPath: addPath,
- register: register
+ register: register,
};
return builder;
@@ -153,7 +153,7 @@
}
sprs.push({
- sprite: s, x: x, y: y, w: w, anchor: o.anchor
+ sprite: s, x: x, y: y, w: w, anchor: o.anchor,
});
return builder;
}
@@ -162,7 +162,7 @@
var o = angular.extend({}, optDefaults.layout.addLabel, opts);
labs.push({
- text: text, x: x, y: y, anchor: o.anchor, style: o.fontStyle
+ text: text, x: x, y: y, anchor: o.anchor, style: o.fontStyle,
});
return builder;
}
@@ -178,7 +178,7 @@
id: id,
w: w,
h: h,
- opts: o
+ opts: o,
},
sprites: sprs,
labels: labs,
@@ -186,7 +186,7 @@
// builder API
addSprite: addSprite,
addLabel: addLabel,
- register: register
+ register: register,
};
return builder;
@@ -246,7 +246,7 @@
function count() {
return {
sprites: sprites.size(),
- layouts: layouts.size()
+ layouts: layouts.size(),
};
}
@@ -278,7 +278,7 @@
sprite: sprite,
layout: layout,
count: count,
- dump: dump
+ dump: dump,
};
return api;
}]
diff --git a/web/gui/src/main/webapp/app/fw/svg/spriteData.js b/web/gui/src/main/webapp/app/fw/svg/spriteData.js
index 367baa7..30221c8 100644
--- a/web/gui/src/main/webapp/app/fw/svg/spriteData.js
+++ b/web/gui/src/main/webapp/app/fw/svg/spriteData.js
@@ -28,18 +28,18 @@
// TODO: define cloud sprite...
vbox: '0 0 305 186',
d: [
- "M91.2,48.4C121.2,6.3,187.9-13.4,219,45.6",
- "M43.1,139.6C21.8,142.9-15.6,108.4,26.1,79",
- "M103.7,150C89,205.2-11.2,167.4,30.5,138",
- "M192.3,147.3c-33.5,48-82.1,32.3-94.5-8.2",
- "M267.1,115c27.9,67.8-77.6,74.3-83.1,41",
- "M34.3,89.9C10.8,79,59.5,10.7,97.2,39.6",
- "M211.9,34.2c51.9-38.8,118,57.4,59,94.5"
+ 'M91.2,48.4C121.2,6.3,187.9-13.4,219,45.6',
+ 'M43.1,139.6C21.8,142.9-15.6,108.4,26.1,79',
+ 'M103.7,150C89,205.2-11.2,167.4,30.5,138',
+ 'M192.3,147.3c-33.5,48-82.1,32.3-94.5-8.2',
+ 'M267.1,115c27.9,67.8-77.6,74.3-83.1,41',
+ 'M34.3,89.9C10.8,79,59.5,10.7,97.2,39.6',
+ 'M211.9,34.2c51.9-38.8,118,57.4,59,94.5',
],
style: {
fill: 'none',
- 'stroke-miterlimit': 10
- }
+ 'stroke-miterlimit': 10,
+ },
};
// TODO: define other core sprites here...
@@ -55,12 +55,12 @@
// ----------------------------------------------------------$$$
// This following code is for initial development of Topo2 sprite layer
ssApi.createSprite('rack', 40, 50)
- .addRect(0, 0, 40, 50, {fill: 'gold1'})
+ .addRect(0, 0, 40, 50, { fill: 'gold1' })
.addPath([
'M5,20h30v5h-30z',
'M5,30h30v5h-30z',
- 'M5,40h30v5h-30z'
- ], {stroke: 'gray1'})
+ 'M5,40h30v5h-30z',
+ ], { stroke: 'gray1' })
.register();
ssApi.createLayout('segmentRouting', 130, 75)
@@ -68,13 +68,13 @@
.addSprite('rack', 40, 40, 20)
.addSprite('rack', 70, 40, 20)
.addSprite('rack', 100, 40, 20)
- .addLabel('Segment Routing', 120, 10, {anchor: 'right'})
+ .addLabel('Segment Routing', 120, 10, { anchor: 'right' })
.register();
ssApi.createLayout('segmentRoutingTwo', 70, 75)
.addSprite('rack', 10, 40, 20)
.addSprite('rack', 40, 40, 20)
- .addLabel('Segment Routing 2', 120, 10, {anchor: 'right'})
+ .addLabel('Segment Routing 2', 120, 10, { anchor: 'right' })
.register();
ssApi.createLayout('plain', 80, 60)
@@ -90,9 +90,9 @@
.factory('SpriteDataService', [
function () {
return {
- registerCoreSprites: registerCoreSprites
+ registerCoreSprites: registerCoreSprites,
};
- }
+ },
]);
}());
diff --git a/web/gui/src/main/webapp/app/fw/svg/svgUtil.js b/web/gui/src/main/webapp/app/fw/svg/svgUtil.js
index 84b6408..1bdb96b 100644
--- a/web/gui/src/main/webapp/app/fw/svg/svgUtil.js
+++ b/web/gui/src/main/webapp/app/fw/svg/svgUtil.js
@@ -82,8 +82,8 @@
}
drag = d3.behavior.drag()
- .origin(function(d) { return d; })
- .on('dragstart', function(d) {
+ .origin(function (d) { return d; })
+ .on('dragstart', function (d) {
if (clickEnabled() || dragEnabled()) {
d.oldX = d.x;
d.oldY = d.y;
@@ -92,7 +92,7 @@
d.dragStarted = true;
}
})
- .on('drag', function(d) {
+ .on('drag', function (d) {
if (dragEnabled()) {
d.px = d3.event.x;
d.py = d3.event.y;
@@ -103,7 +103,7 @@
}
}
})
- .on('dragend', function(d) {
+ .on('dragend', function (d) {
d3.event.sourceEvent.stopPropagation();
if (d.dragStarted) {
@@ -170,22 +170,22 @@
// Colors per Mojo-Design's color palette.. (version two)
// blue lt blue red green brown teal lime
- var lightNorm = ['#5b99d2', '#66cef6', '#d05a55', '#0f9d58', '#ba7941', '#3dc0bf', '#56af00' ],
- lightMute = ['#9ebedf', '#abdef5', '#d79a96', '#7cbe99', '#cdab8d', '#96d5d5', '#a0c96d' ],
+ var lightNorm = ['#5b99d2', '#66cef6', '#d05a55', '#0f9d58', '#ba7941', '#3dc0bf', '#56af00'],
+ lightMute = ['#9ebedf', '#abdef5', '#d79a96', '#7cbe99', '#cdab8d', '#96d5d5', '#a0c96d'],
- darkNorm = ['#5b99d2', '#66cef6', '#d05a55', '#0f9d58', '#ba7941', '#3dc0bf', '#56af00' ],
- darkMute = ['#9ebedf', '#abdef5', '#d79a96', '#7cbe99', '#cdab8d', '#96d5d5', '#a0c96d' ];
+ darkNorm = ['#5b99d2', '#66cef6', '#d05a55', '#0f9d58', '#ba7941', '#3dc0bf', '#56af00'],
+ darkMute = ['#9ebedf', '#abdef5', '#d79a96', '#7cbe99', '#cdab8d', '#96d5d5', '#a0c96d'];
var colors= {
light: {
norm: d3.scale.ordinal().range(lightNorm),
- mute: d3.scale.ordinal().range(lightMute)
+ mute: d3.scale.ordinal().range(lightMute),
},
dark: {
norm: d3.scale.ordinal().range(darkNorm),
- mute: d3.scale.ordinal().range(darkMute)
- }
+ mute: d3.scale.ordinal().range(darkMute),
+ },
};
function cat7() {
@@ -231,7 +231,7 @@
cx: x,
cy: y,
r: 5,
- fill: f
+ fill: f,
});
});
g.append('rect').attr({
@@ -240,13 +240,13 @@
width: 32,
height: 10,
rx: 2,
- fill: '#888'
+ fill: '#888',
});
g.append('text').text(theme + what)
.attr({
x: 142,
y: k * 20 + 2,
- fill: 'white'
+ fill: 'white',
})
.style('font-size', '4pt');
}
@@ -255,7 +255,7 @@
return {
testCard: testCard,
- getColor: getColor
+ getColor: getColor,
};
}
@@ -279,7 +279,7 @@
}
function stripPx(s) {
- return s.replace(/px$/,'');
+ return s.replace(/px$/, '');
}
function safeId(s) {
@@ -318,7 +318,7 @@
rotate: rotate,
stripPx: stripPx,
safeId: safeId,
- visible: visible
+ visible: visible,
};
}]);
}());
diff --git a/web/gui/src/main/webapp/app/fw/svg/zoom.js b/web/gui/src/main/webapp/app/fw/svg/zoom.js
index 00487ec..587cf6a 100644
--- a/web/gui/src/main/webapp/app/fw/svg/zoom.js
+++ b/web/gui/src/main/webapp/app/fw/svg/zoom.js
@@ -25,7 +25,7 @@
zoomMin: 0.05,
zoomMax: 50,
zoomEnabled: function (ev) { return true; },
- zoomCallback: function () {}
+ zoomCallback: function () {},
};
// injected references to services
@@ -95,7 +95,7 @@
settings.zoomLayer.transition()
.duration(transition || 0)
- .attr("transform",
+ .attr('transform',
'translate(' + translate + ')scale(' + scale + ')');
settings.zoomCallback(translate, scale);
@@ -109,7 +109,7 @@
},
reset: function () {
- zoomer.panZoom([0,0], 1);
+ zoomer.panZoom([0, 0], 1);
},
translate: function () {
@@ -122,7 +122,7 @@
scaleExtent: function () {
return zoom.scaleExtent();
- }
+ },
};
// apply the zoom behavior to the SVG element
@@ -130,12 +130,12 @@
// Remove zoom on double click (prevents a
// false zoom navigating regions)
- settings.svg.on("dblclick.zoom", null);
+ settings.svg.on('dblclick.zoom', null);
return zoomer;
}
return {
- createZoomer: createZoomer
+ createZoomer: createZoomer,
};
}]);