aboutsummaryrefslogtreecommitdiffstats
path: root/framework/src/onos/web/gui/src/main/webapp/app/fw/layer
diff options
context:
space:
mode:
Diffstat (limited to 'framework/src/onos/web/gui/src/main/webapp/app/fw/layer')
-rw-r--r--framework/src/onos/web/gui/src/main/webapp/app/fw/layer/flash.css49
-rw-r--r--framework/src/onos/web/gui/src/main/webapp/app/fw/layer/flash.js165
-rw-r--r--framework/src/onos/web/gui/src/main/webapp/app/fw/layer/layer.js25
-rw-r--r--framework/src/onos/web/gui/src/main/webapp/app/fw/layer/panel.css54
-rw-r--r--framework/src/onos/web/gui/src/main/webapp/app/fw/layer/panel.js216
-rw-r--r--framework/src/onos/web/gui/src/main/webapp/app/fw/layer/quickhelp.css64
-rw-r--r--framework/src/onos/web/gui/src/main/webapp/app/fw/layer/quickhelp.js387
-rw-r--r--framework/src/onos/web/gui/src/main/webapp/app/fw/layer/veil.css50
-rw-r--r--framework/src/onos/web/gui/src/main/webapp/app/fw/layer/veil.js99
9 files changed, 0 insertions, 1109 deletions
diff --git a/framework/src/onos/web/gui/src/main/webapp/app/fw/layer/flash.css b/framework/src/onos/web/gui/src/main/webapp/app/fw/layer/flash.css
deleted file mode 100644
index 02064625..00000000
--- a/framework/src/onos/web/gui/src/main/webapp/app/fw/layer/flash.css
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Copyright 2014,2015 Open Networking Laboratory
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/*
- ONOS GUI -- Flash Service -- CSS file
- */
-
-#flash {
- z-index: 1400;
-}
-
-#flash svg {
- position: absolute;
- bottom: 0;
- opacity: 0.8;
-}
-
-.light #flash svg g.flashItem rect {
- fill: #ccc;
-}
-.dark #flash svg g.flashItem rect {
- fill: #555;
-}
-
-#flash svg g.flashItem text {
- stroke: none;
- text-anchor: middle;
- alignment-baseline: middle;
- font-size: 16pt;
-}
-.light #flash svg g.flashItem text {
- fill: #333;
-}
-.dark #flash svg g.flashItem text {
- fill: #999;
-}
diff --git a/framework/src/onos/web/gui/src/main/webapp/app/fw/layer/flash.js b/framework/src/onos/web/gui/src/main/webapp/app/fw/layer/flash.js
deleted file mode 100644
index 0d95b774..00000000
--- a/framework/src/onos/web/gui/src/main/webapp/app/fw/layer/flash.js
+++ /dev/null
@@ -1,165 +0,0 @@
-/*
- * Copyright 2015 Open Networking Laboratory
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/*
- ONOS GUI -- Layer -- Flash Service
-
- Provides a mechanism to flash short informational messages to the screen
- to alert the user of something, e.g. "Hosts visible" or "Hosts hidden".
- */
-(function () {
- 'use strict';
-
- // injected references
- var $log, $timeout;
-
- // configuration
- var defaultSettings = {
- fade: 200,
- showFor: 1200
- },
- w = '100%',
- h = 200,
- xpad = 20,
- ypad = 10,
- rx = 10,
- vbox = '-200 -' + (h/2) + ' 400 ' + h;
-
- // internal state
- var settings,
- timer = null,
- data = [],
- enabled;
-
- // DOM elements
- var flashDiv, svg;
-
-
- function computeBox(el) {
- var text = el.select('text'),
- box = text.node().getBBox();
-
- // center
- box.x = -box.width / 2;
- box.y = -box.height / 2;
-
- // add some padding
- box.x -= xpad;
- box.width += xpad * 2;
- box.y -= ypad;
- box.height += ypad * 2;
-
- return box;
- }
-
- function updateFlash() {
- if (!svg) {
- svg = flashDiv.append('svg').attr({
- width: w,
- height: h,
- viewBox: vbox
- });
- }
-
- var items = svg.selectAll('.flashItem')
- .data(data);
-
- // this is when there is an existing item
- items.each(function (msg) {
- var el = d3.select(this),
- box;
-
- el.select('text').text(msg);
- box = computeBox(el);
- el.select('rect').attr(box);
- });
-
-
- // this is when there is no existing item
- var entering = items.enter()
- .append('g')
- .attr({
- class: 'flashItem',
- opacity: 0
- })
- .transition()
- .duration(settings.fade)
- .attr('opacity', 1);
-
- entering.each(function (msg) {
- var el = d3.select(this),
- box;
-
- el.append('rect').attr('rx', rx);
- el.append('text').text(msg);
- box = computeBox(el);
- el.select('rect').attr(box);
- });
-
- items.exit()
- .transition()
- .duration(settings.fade)
- .attr('opacity', 0)
- .remove();
-
- if (svg && data.length === 0) {
- svg.transition()
- .delay(settings.fade + 10)
- .remove();
- svg = null;
- }
- }
-
- function flash(msg) {
- if (!enabled) return;
-
- if (timer) {
- $timeout.cancel(timer);
- }
-
- timer = $timeout(function () {
- data = [];
- updateFlash();
- }, settings.showFor);
-
- data = [msg];
- updateFlash();
- }
-
- function enable(b) {
- enabled = !!b;
- }
-
- angular.module('onosLayer')
- .factory('FlashService', ['$log', '$timeout',
- function (_$log_, _$timeout_) {
- $log = _$log_;
- $timeout = _$timeout_;
-
- function initFlash(opts) {
- settings = angular.extend({}, defaultSettings, opts);
- flashDiv = d3.select('#flash');
- enabled = true;
- }
-
- return {
- initFlash: initFlash,
- flash: flash,
- enable: enable
- };
- }]);
-
-}());
diff --git a/framework/src/onos/web/gui/src/main/webapp/app/fw/layer/layer.js b/framework/src/onos/web/gui/src/main/webapp/app/fw/layer/layer.js
deleted file mode 100644
index a47f53e0..00000000
--- a/framework/src/onos/web/gui/src/main/webapp/app/fw/layer/layer.js
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * Copyright 2015 Open Networking Laboratory
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/*
- ONOS GUI -- Layers Module
- */
-(function () {
- 'use strict';
-
- angular.module('onosLayer', ['onosUtil']);
-
-}());
diff --git a/framework/src/onos/web/gui/src/main/webapp/app/fw/layer/panel.css b/framework/src/onos/web/gui/src/main/webapp/app/fw/layer/panel.css
deleted file mode 100644
index ded05cf1..00000000
--- a/framework/src/onos/web/gui/src/main/webapp/app/fw/layer/panel.css
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Copyright 2014,2015 Open Networking Laboratory
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/*
- ONOS GUI -- Panel Service -- CSS file
- */
-
-.floatpanel {
- position: absolute;
- z-index: 100;
- display: block;
- top: 64px;
- width: 200px;
- right: -220px;
- opacity: 0;
-
- padding: 10px;
- font-size: 10pt;
-
- -moz-border-radius: 6px;
- border-radius: 6px;
-}
-
-.floatpanel.dialog {
- top: 180px;
-}
-
-html[data-platform='iPad'] .floatpanel {
- top: 80px;
-}
-
-.light .floatpanel {
- background-color: rgba(255,255,255,0.8);
- color: black;
- box-shadow: 0 2px 12px #777;
-}
-.dark .floatpanel {
- background-color: rgba(50,50,50,0.8);
- color: #ccc;
- box-shadow: 0 2px 12px #000;
-}
diff --git a/framework/src/onos/web/gui/src/main/webapp/app/fw/layer/panel.js b/framework/src/onos/web/gui/src/main/webapp/app/fw/layer/panel.js
deleted file mode 100644
index 10f04813..00000000
--- a/framework/src/onos/web/gui/src/main/webapp/app/fw/layer/panel.js
+++ /dev/null
@@ -1,216 +0,0 @@
-/*
- * Copyright 2015 Open Networking Laboratory
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/*
- ONOS GUI -- Layer -- Panel Service
- */
-(function () {
- 'use strict';
-
- var $log, fs;
-
- var defaultSettings = {
- edge: 'right',
- width: 200,
- margin: 20,
- hideMargin: 20,
- xtnTime: 750,
- fade: true
- };
-
- var panels,
- panelLayer;
-
-
- function init() {
- panelLayer = d3.select('#floatpanels');
- panelLayer.html('');
- panels = {};
- }
-
- // helpers for panel
- function noop() {}
-
- function margin(p) {
- return p.settings.margin;
- }
- function hideMargin(p) {
- return p.settings.hideMargin;
- }
- function noPx(p, what) {
- return Number(p.el.style(what).replace(/px$/, ''));
- }
- function widthVal(p) {
- return noPx(p, 'width');
- }
- function heightVal(p) {
- return noPx(p, 'height');
- }
- function pxShow(p) {
- return margin(p) + 'px';
- }
- function pxHide(p) {
- return (-hideMargin(p) - widthVal(p) - (noPx(p, 'padding') * 2)) + 'px';
- }
-
- function makePanel(id, settings) {
- var p = {
- id: id,
- settings: settings,
- on: false,
- el: null
- },
- api = {
- show: showPanel,
- hide: hidePanel,
- toggle: togglePanel,
- empty: emptyPanel,
- append: appendPanel,
- width: panelWidth,
- height: panelHeight,
- isVisible: panelIsVisible,
- classed: classed,
- el: panelEl
- };
-
- p.el = panelLayer.append('div')
- .attr('id', id)
- .attr('class', 'floatpanel')
- .style('opacity', 0);
-
- // has to be called after el is set
- p.el.style(p.settings.edge, pxHide(p));
- panelWidth(p.settings.width);
- if (p.settings.height) {
- panelHeight(p.settings.height);
- }
-
- panels[id] = p;
-
- function showPanel(cb) {
- var endCb = fs.isF(cb) || noop;
- p.on = true;
- p.el.transition().duration(p.settings.xtnTime)
- .each('end', endCb)
- .style(p.settings.edge, pxShow(p))
- .style('opacity', 1);
- }
-
- function hidePanel(cb) {
- var endCb = fs.isF(cb) || noop,
- endOpacity = p.settings.fade ? 0 : 1;
- p.on = false;
- p.el.transition().duration(p.settings.xtnTime)
- .each('end', endCb)
- .style(p.settings.edge, pxHide(p))
- .style('opacity', endOpacity);
- }
-
- function togglePanel(cb) {
- if (p.on) {
- hidePanel(cb);
- } else {
- showPanel(cb);
- }
- return p.on;
- }
-
- function emptyPanel() {
- return p.el.html('');
- }
-
- function appendPanel(what) {
- return p.el.append(what);
- }
-
- function panelWidth(w) {
- if (w === undefined) {
- return widthVal(p);
- }
- p.el.style('width', w + 'px');
- }
-
- function panelHeight(h) {
- if (h === undefined) {
- return heightVal(p);
- }
- p.el.style('height', h + 'px');
- }
-
- function panelIsVisible() {
- return p.on;
- }
-
- function classed(cls, bool) {
- return p.el.classed(cls, bool);
- }
-
- function panelEl() {
- return p.el;
- }
-
- return api;
- }
-
- function removePanel(id) {
- panelLayer.select('#' + id).remove();
- delete panels[id];
- }
-
- angular.module('onosLayer')
- .factory('PanelService',
- ['$log', '$window', 'FnService',
-
- function (_$log_, _$window_, _fs_) {
- $log = _$log_;
- fs = _fs_;
-
- function createPanel(id, opts) {
- var settings = angular.extend({}, defaultSettings, opts);
- if (!id) {
- $log.warn('createPanel: no ID given');
- return null;
- }
- if (panels[id]) {
- $log.warn('Panel with ID "' + id + '" already exists');
- return null;
- }
- if (fs.debugOn('widget')) {
- $log.debug('creating panel:', id, settings);
- }
- return makePanel(id, settings);
- }
-
- function destroyPanel(id) {
- if (panels[id]) {
- if (fs.debugOn('widget')) {
- $log.debug('destroying panel:', id);
- }
- removePanel(id);
- } else {
- if (fs.debugOn('widget')) {
- $log.debug('no panel to destroy:', id);
- }
- }
- }
-
- return {
- init: init,
- createPanel: createPanel,
- destroyPanel: destroyPanel
- };
- }]);
-}());
diff --git a/framework/src/onos/web/gui/src/main/webapp/app/fw/layer/quickhelp.css b/framework/src/onos/web/gui/src/main/webapp/app/fw/layer/quickhelp.css
deleted file mode 100644
index bb806d8a..00000000
--- a/framework/src/onos/web/gui/src/main/webapp/app/fw/layer/quickhelp.css
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Copyright 2014,2015 Open Networking Laboratory
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/*
- ONOS GUI -- Quick Help Service -- CSS file
- */
-
-#quickhelp {
- z-index: 1300;
-}
-
-#quickhelp svg {
- position: absolute;
- top: 180px;
- opacity: 1;
-}
-
-#quickhelp svg g.help rect {
- fill: black;
- opacity: 0.7;
-}
-
-#quickhelp svg text.title {
- font-size: 10pt;
- font-style: italic;
- text-anchor: middle;
- fill: #999;
-}
-
-#quickhelp svg g.keyItem {
- fill: white;
-}
-
-#quickhelp svg g line.qhrowsep {
- stroke: #888;
- stroke-dasharray: 2 2;
-}
-
-#quickhelp svg text {
- font-size: 7pt;
- alignment-baseline: middle;
-}
-
-#quickhelp svg text.key {
- fill: #add;
-}
-
-#quickhelp svg text.desc {
- fill: #ddd;
-}
-
diff --git a/framework/src/onos/web/gui/src/main/webapp/app/fw/layer/quickhelp.js b/framework/src/onos/web/gui/src/main/webapp/app/fw/layer/quickhelp.js
deleted file mode 100644
index a25cf68d..00000000
--- a/framework/src/onos/web/gui/src/main/webapp/app/fw/layer/quickhelp.js
+++ /dev/null
@@ -1,387 +0,0 @@
-/*
- * Copyright 2015 Open Networking Laboratory
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/*
- ONOS GUI -- Layer -- Quick Help Service
-
- Provides a mechanism to display key bindings and mouse gesture notes.
- */
-(function () {
- 'use strict';
-
- // injected references
- var $log, fs, sus;
-
- // configuration
- var defaultSettings = {
- fade: 500
- },
- w = '100%',
- h = '80%',
- vbox = '-200 0 400 400',
- pad = 10,
- offy = 45,
- sepYDelta = 20,
- colXDelta = 16,
- yTextSpc = 12,
- offDesc = 8;
-
- // internal state
- var settings,
- data = [],
- yCount;
-
- // DOM elements
- var qhdiv, svg, pane, rect, items;
-
- // key-logical-name to key-display lookup..
- var keyDisp = {
- equals: '=',
- slash: '/',
- backSlash: '\\',
- backQuote: '`',
- leftArrow: 'L-arrow',
- upArrow: 'U-arrow',
- rightArrow: 'R-arrow',
- downArrow: 'D-arrow'
- };
-
- // list of needed bindings to use in aggregateData
- var neededBindings = [
- 'globalKeys', 'globalFormat', 'viewKeys', 'viewGestures'
- ];
-
- // ===========================================
- // === Function Definitions ===
-
- function mkKeyDisp(id) {
- var v = keyDisp[id] || id;
- return fs.cap(v);
- }
-
- function addSeparator(el, i) {
- var y = sepYDelta/2 - 5;
- el.append('line')
- .attr({ 'class': 'qhrowsep', x1: 0, y1: y, x2: 0, y2: y });
- }
-
- function addContent(el, data, ri) {
- var xCount = 0,
- clsPfx = 'qh-r' + ri + '-c';
-
- function addColumn(el, c, i) {
- var cls = clsPfx + i,
- oy = 0,
- aggKey = el.append('g').attr('visibility', 'hidden'),
- gcol = el.append('g').attr({
- 'class': cls,
- transform: sus.translate(xCount, 0)
- });
-
- c.forEach(function (j) {
- var k = j[0],
- v = j[1];
-
- if (k !== '-') {
- aggKey.append('text').text(k);
-
- gcol.append('text').text(k)
- .attr({
- 'class': 'key',
- y: oy
- });
- gcol.append('text').text(v)
- .attr({
- 'class': 'desc',
- y: oy
- });
- }
-
- oy += yTextSpc;
- });
-
- // adjust position of descriptions, based on widest key
- var kbox = aggKey.node().getBBox(),
- ox = kbox.width + offDesc;
- gcol.selectAll('.desc').attr('x', ox);
- aggKey.remove();
-
- // now update x-offset for next column
- var bbox = gcol.node().getBBox();
- xCount += bbox.width + colXDelta;
- }
-
- data.forEach(function (d, i) {
- addColumn(el, d, i);
- });
-
- // finally, return the height of the row..
- return el.node().getBBox().height;
- }
-
- function updateKeyItems() {
- var rows = items.selectAll('.qhRow').data(data);
-
- yCount = offy;
-
- var entering = rows.enter()
- .append('g')
- .attr({
- 'class': 'qhrow'
- });
-
- entering.each(function (r, i) {
- var el = d3.select(this),
- sep = r.type === 'sep',
- dy;
-
- el.attr('transform', sus.translate(0, yCount));
-
- if (sep) {
- addSeparator(el, i);
- yCount += sepYDelta;
- } else {
- dy = addContent(el, r.data, i);
- yCount += dy;
- }
- });
-
- // size the backing rectangle
- var ibox = items.node().getBBox(),
- paneW = ibox.width + pad * 2,
- paneH = ibox.height + offy;
-
- items.selectAll('.qhrowsep').attr('x2', ibox.width);
- items.attr('transform', sus.translate(-paneW/2, -pad));
- rect.attr({
- width: paneW,
- height: paneH,
- transform: sus.translate(-paneW/2-pad, 0)
- });
-
- }
-
- function checkFmt(fmt) {
- // should be a single array of keys,
- // or array of arrays of keys (one per column).
- // return null if there is a problem.
- var a = fs.isA(fmt),
- n = a && a.length,
- ns = 0,
- na = 0;
-
- if (n) {
- // it is an array which has some content
- a.forEach(function (d) {
- fs.isA(d) && na++;
- fs.isS(d) && ns++;
- });
- if (na === n || ns === n) {
- // all arrays or all strings...
- return a;
- }
- }
- return null;
- }
-
- function buildBlock(map, fmt) {
- var b = [];
- fmt.forEach(function (k) {
- var v = map.get(k),
- a = fs.isA(v),
- d = (a && a[1]);
-
- // '-' marks a separator; d is the description
- if (k === '-' || d) {
- b.push([mkKeyDisp(k), d]);
- }
- });
- return b;
- }
-
- function emptyRow() {
- return { type: 'row', data: [] };
- }
-
- function mkArrRow(fmt) {
- var d = emptyRow();
- d.data.push(fmt);
- return d;
- }
-
- function mkColumnarRow(map, fmt) {
- var d = emptyRow();
- fmt.forEach(function (a) {
- d.data.push(buildBlock(map, a));
- });
- return d;
- }
-
- function mkMapRow(map, fmt) {
- var d = emptyRow();
- d.data.push(buildBlock(map, fmt));
- return d;
- }
-
- function addRow(row) {
- var d = row || { type: 'sep' };
- data.push(d);
- }
-
- function aggregateData(bindings) {
- var hf = '_helpFormat',
- gmap = d3.map(bindings.globalKeys),
- gfmt = bindings.globalFormat,
- vmap = d3.map(bindings.viewKeys),
- vgest = bindings.viewGestures,
- vfmt, vkeys;
-
- // filter out help format entry
- vfmt = checkFmt(vmap.get(hf));
- vmap.remove(hf);
-
- // if bad (or no) format, fallback to sorted keys
- if (!vfmt) {
- vkeys = vmap.keys();
- vfmt = vkeys.sort();
- }
-
- data = [];
-
- addRow(mkMapRow(gmap, gfmt));
- addRow();
- addRow(fs.isA(vfmt[0]) ? mkColumnarRow(vmap, vfmt) : mkMapRow(vmap, vfmt));
- addRow();
- addRow(mkArrRow(vgest));
- }
-
-
- function popBind(bindings) {
- pane = svg.append('g')
- .attr({
- class: 'help',
- opacity: 0
- });
-
- rect = pane.append('rect')
- .attr('rx', 8);
-
- pane.append('text')
- .text('Quick Help')
- .attr({
- class: 'title',
- dy: '1.2em',
- transform: sus.translate(-pad,0)
- });
-
- items = pane.append('g');
- aggregateData(bindings);
- updateKeyItems();
-
- _fade(1);
- }
-
- function fadeBindings() {
- _fade(0);
- }
-
- function _fade(o) {
- svg.selectAll('g.help')
- .transition()
- .duration(settings.fade)
- .attr('opacity', o);
- }
-
- function addSvg() {
- svg = qhdiv.append('svg')
- .attr({
- width: w,
- height: h,
- viewBox: vbox
- });
- }
-
- function removeSvg() {
- svg.transition()
- .delay(settings.fade + 20)
- .remove();
- }
-
- function goodBindings(bindings) {
- var warnPrefix = 'Quickhelp Service: showQuickHelp(), ';
- if (!bindings || !fs.isO(bindings) || fs.isEmptyObject(bindings)) {
- $log.warn(warnPrefix + 'invalid bindings object');
- return false;
- }
- if (!(neededBindings.every(function (key) { return key in bindings; }))) {
- $log.warn(
- warnPrefix +
- 'needed bindings for help panel not provided:',
- neededBindings
- );
- return false
- }
- return true;
- }
-
- // ===========================================
- // === Module Definition ===
-
- angular.module('onosLayer')
- .factory('QuickHelpService',
- ['$log', 'FnService', 'SvgUtilService',
-
- function (_$log_, _fs_, _sus_) {
- $log = _$log_;
- fs = _fs_;
- sus = _sus_;
-
- function initQuickHelp(opts) {
- settings = angular.extend({}, defaultSettings, fs.isO(opts));
- qhdiv = d3.select('#quickhelp');
- }
-
- function showQuickHelp(bindings) {
- svg = qhdiv.select('svg');
- if (!goodBindings(bindings)) {
- return null;
- }
- if (svg.empty()) {
- addSvg();
- popBind(bindings);
- } else {
- hideQuickHelp();
- }
- }
-
- function hideQuickHelp() {
- svg = qhdiv.select('svg');
- if (!svg.empty()) {
- fadeBindings();
- removeSvg();
- return true;
- }
- return false;
- }
-
- return {
- initQuickHelp: initQuickHelp,
- showQuickHelp: showQuickHelp,
- hideQuickHelp: hideQuickHelp
- };
- }]);
-
-}());
diff --git a/framework/src/onos/web/gui/src/main/webapp/app/fw/layer/veil.css b/framework/src/onos/web/gui/src/main/webapp/app/fw/layer/veil.css
deleted file mode 100644
index afef94ac..00000000
--- a/framework/src/onos/web/gui/src/main/webapp/app/fw/layer/veil.css
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright 2015 Open Networking Laboratory
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/*
- ONOS GUI -- Veil Service -- CSS file
- */
-
-#veil {
- z-index: 5000;
- display: none;
- position: absolute;
- top: 0;
- left: 0;
-}
-
-.light #veil {
- background-color: rgba(0,0,0,0.75);
-}
-.dark #veil {
- background-color: rgba(64,64,64,0.75);
-}
-
-#veil .msg {
- position: absolute;
- padding: 60px;
-}
-
-#veil .msg p {
- display: block;
- font-size: 14pt;
- font-style: italic;
- color: #ddd;
-}
-
-#veil svg .glyph {
- fill: #222;
-}
diff --git a/framework/src/onos/web/gui/src/main/webapp/app/fw/layer/veil.js b/framework/src/onos/web/gui/src/main/webapp/app/fw/layer/veil.js
deleted file mode 100644
index fc0530af..00000000
--- a/framework/src/onos/web/gui/src/main/webapp/app/fw/layer/veil.js
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * Copyright 2015 Open Networking Laboratory
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/*
- ONOS GUI -- Layer -- Veil Service
-
- Provides a mechanism to display an overlaying div with information.
- Used mainly for web socket connection interruption.
- */
-(function () {
- 'use strict';
-
- // injected references
- var $log, $route, fs, ks, gs;
-
- var veil;
-
- function init() {
- var wSize = fs.windowSize(),
- ww = wSize.width,
- wh = wSize.height,
- shrink = wh * 0.3,
- birdDim = wh - shrink,
- birdCenter = (ww - birdDim) / 2,
- svg;
-
- veil = d3.select('#veil');
-
- svg = veil.select('svg').attr({
- width: ww,
- height: wh
- }).style('opacity', 0.2);
-
- gs.addGlyph(svg, 'bird', birdDim, false, [birdCenter, shrink/2]);
- }
-
- // msg should be an array of strings
- function show(msg) {
- var msgs = fs.isA(msg) || [msg],
- pdiv = veil.select('.msg');
- pdiv.selectAll('p').remove();
-
- msgs.forEach(function (line) {
- pdiv.append('p').text(line);
- });
-
- veil.style('display', 'block');
- ks.enableKeys(false);
- }
-
- function hide() {
- veil.style('display', 'none');
- ks.enableKeys(true);
- }
-
- // function that only invokes the veil if the caller is the current view
- // TODO: review - is this deprecated ?
- function lostServer(ctrlName, msg) {
- if ($route.current.$$route.controller === ctrlName) {
- $log.debug('VEIL-service: ', ctrlName);
- show(msg)
- } else {
- $log.debug('VEIL-service: IGNORING ', ctrlName);
- }
- }
-
- angular.module('onosLayer')
- .factory('VeilService',
- ['$log', '$route', 'FnService', 'KeyService', 'GlyphService',
-
- function (_$log_, _$route_, _fs_, _ks_, _gs_) {
- $log = _$log_;
- $route = _$route_;
- fs = _fs_;
- ks = _ks_;
- gs = _gs_;
-
- return {
- init: init,
- show: show,
- hide: hide,
- lostServer: lostServer
- };
- }]);
-
-}());