Simon Hunt | ef31fb2 | 2014-12-19 13:16:44 -0800 | [diff] [blame] | 1 | /* |
Brian O'Connor | a09fe5b | 2017-08-03 21:12:30 -0700 | [diff] [blame] | 2 | * Copyright 2014-present Open Networking Foundation |
Simon Hunt | ef31fb2 | 2014-12-19 13:16:44 -0800 | [diff] [blame] | 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | /* |
| 18 | ONOS GUI -- Topology View Module |
Simon Hunt | ef31fb2 | 2014-12-19 13:16:44 -0800 | [diff] [blame] | 19 | */ |
| 20 | |
| 21 | (function () { |
| 22 | 'use strict'; |
Simon Hunt | 6cc5369 | 2015-01-07 11:33:45 -0800 | [diff] [blame] | 23 | |
| 24 | var moduleDependencies = [ |
Simon Hunt | 36a58c6 | 2015-04-08 11:00:07 -0700 | [diff] [blame] | 25 | 'ngCookies', |
Simon Hunt | 6cc5369 | 2015-01-07 11:33:45 -0800 | [diff] [blame] | 26 | 'onosUtil', |
Simon Hunt | 1e4a001 | 2015-01-21 11:36:08 -0800 | [diff] [blame] | 27 | 'onosSvg', |
Steven Burrows | 1c2a968 | 2017-07-14 16:52:46 +0100 | [diff] [blame] | 28 | 'onosRemote', |
Simon Hunt | 6cc5369 | 2015-01-07 11:33:45 -0800 | [diff] [blame] | 29 | ]; |
| 30 | |
Simon Hunt | a428124 | 2016-02-26 20:18:45 -0800 | [diff] [blame] | 31 | // references to injected services |
Steven Burrows | 1c2a968 | 2017-07-14 16:52:46 +0100 | [diff] [blame] | 32 | var $scope, $log, $loc, $timeout, |
Simon Hunt | 7faabd5 | 2016-08-18 16:16:19 -0700 | [diff] [blame] | 33 | fs, ks, zs, gs, ms, sus, flash, wss, ps, th, tds, t3s, tes, tfs, tps, |
Steven Burrows | 1c2a968 | 2017-07-14 16:52:46 +0100 | [diff] [blame] | 34 | tis, tms, tss, tls, tos, fltr, ttbs, tspr, tov; |
Simon Hunt | 6cc5369 | 2015-01-07 11:33:45 -0800 | [diff] [blame] | 35 | |
| 36 | // DOM elements |
Simon Hunt | 2052e5d | 2015-04-13 17:40:44 -0700 | [diff] [blame] | 37 | var ovtopo, svg, defs, zoomLayer, mapG, spriteG, forceG, noDevsLayer; |
Simon Hunt | 6cc5369 | 2015-01-07 11:33:45 -0800 | [diff] [blame] | 38 | |
| 39 | // Internal state |
Simon Hunt | 5989ddf | 2017-08-02 20:38:12 -0700 | [diff] [blame] | 40 | var zoomer, |
| 41 | actionMap, |
Steven Burrows | 1c2a968 | 2017-07-14 16:52:46 +0100 | [diff] [blame] | 42 | topoLion = function (x) { return '#' + x + '#'; }; // func replaced later |
Simon Hunt | 6cc5369 | 2015-01-07 11:33:45 -0800 | [diff] [blame] | 43 | |
Simon Hunt | cacce34 | 2015-01-07 16:13:05 -0800 | [diff] [blame] | 44 | // --- Short Cut Keys ------------------------------------------------ |
| 45 | |
Simon Hunt | 8d22c4b | 2015-08-06 16:24:43 -0700 | [diff] [blame] | 46 | function setUpKeys(overlayKeys) { |
Simon Hunt | 5724fb4 | 2015-02-05 16:59:40 -0800 | [diff] [blame] | 47 | // key bindings need to be made after the services have been injected |
| 48 | // thus, deferred to here... |
Simon Hunt | 5989ddf | 2017-08-02 20:38:12 -0700 | [diff] [blame] | 49 | |
| 50 | // we need functions that can be invoked after LION bundle loaded |
Steven Burrows | 1c2a968 | 2017-07-14 16:52:46 +0100 | [diff] [blame] | 51 | function togInst() { return topoLion('tbtt_tog_instances'); } |
| 52 | function togSumm() { return topoLion('tbtt_tog_summary'); } |
| 53 | function togUseDet() { return topoLion('tbtt_tog_use_detail'); } |
Simon Hunt | 5989ddf | 2017-08-02 20:38:12 -0700 | [diff] [blame] | 54 | |
Steven Burrows | 1c2a968 | 2017-07-14 16:52:46 +0100 | [diff] [blame] | 55 | function togHost() { return topoLion('tbtt_tog_host'); } |
| 56 | function togOff() { return topoLion('tbtt_tog_offline'); } |
| 57 | function togPortHi() { return topoLion('tbtt_tog_porthi'); } |
Simon Hunt | 5989ddf | 2017-08-02 20:38:12 -0700 | [diff] [blame] | 58 | |
Steven Burrows | 1c2a968 | 2017-07-14 16:52:46 +0100 | [diff] [blame] | 59 | function showBad() { return topoLion('tbtt_bad_links'); } |
| 60 | function togMap() { return topoLion('tbtt_tog_map'); } |
| 61 | function selMap() { return topoLion('tbtt_sel_map'); } |
| 62 | function togSpr() { return topoLion('tbtt_tog_sprite'); } |
Simon Hunt | 5989ddf | 2017-08-02 20:38:12 -0700 | [diff] [blame] | 63 | |
Steven Burrows | 1c2a968 | 2017-07-14 16:52:46 +0100 | [diff] [blame] | 64 | function rstLoc() { return topoLion('tbtt_reset_loc'); } |
| 65 | function togOb() { return topoLion('tbtt_tog_oblique'); } |
| 66 | function cycLayer() { return topoLion('tbtt_cyc_layers'); } |
| 67 | function cycDev() { return topoLion('tbtt_cyc_dev_labs'); } |
| 68 | function cycHost() { return topoLion('tbtt_cyc_host_labs'); } |
Simon Hunt | 5989ddf | 2017-08-02 20:38:12 -0700 | [diff] [blame] | 69 | |
Steven Burrows | 1c2a968 | 2017-07-14 16:52:46 +0100 | [diff] [blame] | 70 | function unpin() { return topoLion('tbtt_unpin_node'); } |
| 71 | function rzoom() { return topoLion('tbtt_reset_zoom'); } |
| 72 | function togtb() { return topoLion('tbtt_tog_toolbar'); } |
| 73 | function eqmaster() { return topoLion('tbtt_eq_master'); } |
Simon Hunt | 5989ddf | 2017-08-02 20:38:12 -0700 | [diff] [blame] | 74 | |
Steven Burrows | 1c2a968 | 2017-07-14 16:52:46 +0100 | [diff] [blame] | 75 | function uiClick() { return topoLion('click'); } |
| 76 | function uiShClick() { return topoLion('shift_click'); } |
| 77 | function uiDrag() { return topoLion('drag'); } |
| 78 | function uiCmdScr() { return topoLion('cmd_scroll'); } |
| 79 | function uiCmdDrag() { return topoLion('cmd_drag'); } |
Simon Hunt | 5989ddf | 2017-08-02 20:38:12 -0700 | [diff] [blame] | 80 | |
Steven Burrows | 1c2a968 | 2017-07-14 16:52:46 +0100 | [diff] [blame] | 81 | function uiClickTxt() { return topoLion('qh_gest_click'); } |
| 82 | function uiShClickTxt() { return topoLion('qh_gest_shift_click'); } |
| 83 | function uiDragTxt() { return topoLion('qh_gest_drag'); } |
| 84 | function uiCmdScrTxt() { return topoLion('qh_gest_cmd_scroll'); } |
| 85 | function uiCmdDragTxt() { return topoLion('qh_gest_cmd_drag'); } |
Simon Hunt | 5989ddf | 2017-08-02 20:38:12 -0700 | [diff] [blame] | 86 | |
Bri Prebilic Cole | 4db8dce | 2015-03-18 13:57:24 -0700 | [diff] [blame] | 87 | actionMap = { |
Simon Hunt | 5989ddf | 2017-08-02 20:38:12 -0700 | [diff] [blame] | 88 | I: [toggleInstances, togInst], |
| 89 | O: [toggleSummary, togSumm], |
| 90 | D: [toggleUseDetailsFlag, togUseDet], |
Simon Hunt | ac4c6f7 | 2015-02-03 19:50:53 -0800 | [diff] [blame] | 91 | |
Simon Hunt | 5989ddf | 2017-08-02 20:38:12 -0700 | [diff] [blame] | 92 | H: [toggleHosts, togHost], |
| 93 | M: [toggleOffline, togOff], |
| 94 | P: [togglePorts, togPortHi], |
Simon Hunt | ac4c6f7 | 2015-02-03 19:50:53 -0800 | [diff] [blame] | 95 | |
Simon Hunt | 5989ddf | 2017-08-02 20:38:12 -0700 | [diff] [blame] | 96 | dash: [tfs.showBadLinks, showBad], |
| 97 | B: [toggleMap, togMap], |
| 98 | G: [openMapSelection, selMap], |
| 99 | S: [toggleSprites, togSpr], |
Simon Hunt | ac4c6f7 | 2015-02-03 19:50:53 -0800 | [diff] [blame] | 100 | |
Simon Hunt | 5989ddf | 2017-08-02 20:38:12 -0700 | [diff] [blame] | 101 | X: [tfs.resetAllLocations, rstLoc], |
| 102 | Z: [tos.toggleOblique, togOb], |
| 103 | N: [fltr.clickAction, cycLayer], |
| 104 | L: [tfs.cycleDeviceLabels, cycDev], |
| 105 | 'shift-L': [tfs.cycleHostLabels, cycHost], |
| 106 | |
| 107 | U: [tfs.unpin, unpin], |
| 108 | R: [resetZoom, rzoom], |
| 109 | dot: [ttbs.toggleToolbar, togtb], |
| 110 | E: [equalizeMasters, eqmaster], |
Simon Hunt | ac4c6f7 | 2015-02-03 19:50:53 -0800 | [diff] [blame] | 111 | |
Steven Burrows | 1c2a968 | 2017-07-14 16:52:46 +0100 | [diff] [blame] | 112 | // -- instance color palette debug |
Simon Hunt | a976134 | 2016-06-10 18:02:53 -0700 | [diff] [blame] | 113 | // 9: function () { sus.cat7().testCard(svg); }, |
| 114 | |
Simon Hunt | 5b024d7 | 2016-01-29 11:02:43 -0800 | [diff] [blame] | 115 | // topology overlay selections |
| 116 | F1: function () { ttbs.fnkey(0); }, |
| 117 | F2: function () { ttbs.fnkey(1); }, |
| 118 | F3: function () { ttbs.fnkey(2); }, |
| 119 | F4: function () { ttbs.fnkey(3); }, |
| 120 | F5: function () { ttbs.fnkey(4); }, |
| 121 | |
Simon Hunt | 08f841d0 | 2015-02-10 14:39:20 -0800 | [diff] [blame] | 122 | esc: handleEscape, |
Simon Hunt | ac4c6f7 | 2015-02-03 19:50:53 -0800 | [diff] [blame] | 123 | |
Simon Hunt | 0906014 | 2015-03-18 20:23:32 -0700 | [diff] [blame] | 124 | _keyListener: ttbs.keyListener, |
| 125 | |
Simon Hunt | 5724fb4 | 2015-02-05 16:59:40 -0800 | [diff] [blame] | 126 | _helpFormat: [ |
Steven Burrows | 1c2a968 | 2017-07-14 16:52:46 +0100 | [diff] [blame] | 127 | ['I', 'O', 'D', 'H', 'M', 'P', 'dash', 'B', 'G', 'S'], |
Simon Hunt | 10618f6 | 2017-06-15 19:30:52 -0700 | [diff] [blame] | 128 | ['X', 'Z', 'N', 'L', 'shift-L', 'U', 'R', '-', 'E', '-', 'dot'], |
Steven Burrows | 1c2a968 | 2017-07-14 16:52:46 +0100 | [diff] [blame] | 129 | [], // this column reserved for overlay actions |
| 130 | ], |
Bri Prebilic Cole | 4db8dce | 2015-03-18 13:57:24 -0700 | [diff] [blame] | 131 | }; |
| 132 | |
Simon Hunt | 8d22c4b | 2015-08-06 16:24:43 -0700 | [diff] [blame] | 133 | if (fs.isO(overlayKeys)) { |
| 134 | mergeKeys(overlayKeys); |
| 135 | } |
| 136 | |
Bri Prebilic Cole | 4db8dce | 2015-03-18 13:57:24 -0700 | [diff] [blame] | 137 | ks.keyBindings(actionMap); |
Simon Hunt | ac4c6f7 | 2015-02-03 19:50:53 -0800 | [diff] [blame] | 138 | |
Simon Hunt | 639dc66 | 2015-02-18 14:19:20 -0800 | [diff] [blame] | 139 | ks.gestureNotes([ |
Simon Hunt | 5989ddf | 2017-08-02 20:38:12 -0700 | [diff] [blame] | 140 | [uiClick, uiClickTxt], |
| 141 | [uiShClick, uiShClickTxt], |
| 142 | [uiDrag, uiDragTxt], |
| 143 | [uiCmdScr, uiCmdScrTxt], |
Steven Burrows | 1c2a968 | 2017-07-14 16:52:46 +0100 | [diff] [blame] | 144 | [uiCmdDrag, uiCmdDragTxt], |
Simon Hunt | 639dc66 | 2015-02-18 14:19:20 -0800 | [diff] [blame] | 145 | ]); |
Simon Hunt | 5724fb4 | 2015-02-05 16:59:40 -0800 | [diff] [blame] | 146 | } |
Simon Hunt | 6cc5369 | 2015-01-07 11:33:45 -0800 | [diff] [blame] | 147 | |
Simon Hunt | 8d22c4b | 2015-08-06 16:24:43 -0700 | [diff] [blame] | 148 | // when a topology overlay is activated, we need to bind their keystrokes |
| 149 | // and include them in the quick-help panel |
| 150 | function mergeKeys(extra) { |
| 151 | var _hf = actionMap._helpFormat[2]; |
Simon Hunt | 7189222 | 2015-09-29 13:39:40 -0700 | [diff] [blame] | 152 | |
| 153 | ks.checkNotGlobal(extra); |
| 154 | |
Simon Hunt | 8d22c4b | 2015-08-06 16:24:43 -0700 | [diff] [blame] | 155 | extra._keyOrder.forEach(function (k) { |
| 156 | var d = extra[k], |
| 157 | cb = d && d.cb, |
| 158 | tt = d && d.tt; |
| 159 | // NOTE: ignore keys that are already defined |
| 160 | if (d && !actionMap[k]) { |
| 161 | actionMap[k] = [cb, tt]; |
| 162 | _hf.push(k); |
| 163 | } |
| 164 | }); |
| 165 | } |
| 166 | |
Simon Hunt | 08f841d0 | 2015-02-10 14:39:20 -0800 | [diff] [blame] | 167 | // --- Keystroke functions ------------------------------------------- |
Simon Hunt | ac4c6f7 | 2015-02-03 19:50:53 -0800 | [diff] [blame] | 168 | |
Simon Hunt | 36a58c6 | 2015-04-08 11:00:07 -0700 | [diff] [blame] | 169 | function toggleInstances(x) { |
Simon Hunt | ee7a3ce | 2015-04-09 13:28:37 -0700 | [diff] [blame] | 170 | updatePrefsState('insts', tis.toggle(x)); |
Simon Hunt | ac4c6f7 | 2015-02-03 19:50:53 -0800 | [diff] [blame] | 171 | tfs.updateDeviceColors(); |
Simon Hunt | 6cc5369 | 2015-01-07 11:33:45 -0800 | [diff] [blame] | 172 | } |
Simon Hunt | ac4c6f7 | 2015-02-03 19:50:53 -0800 | [diff] [blame] | 173 | |
Simon Hunt | ee7a3ce | 2015-04-09 13:28:37 -0700 | [diff] [blame] | 174 | function toggleSummary(x) { |
| 175 | updatePrefsState('summary', tps.toggleSummary(x)); |
Simon Hunt | 18bf982 | 2015-02-12 17:35:45 -0800 | [diff] [blame] | 176 | } |
| 177 | |
Simon Hunt | 239e588 | 2015-04-23 15:07:04 -0700 | [diff] [blame] | 178 | function toggleUseDetailsFlag(x) { |
| 179 | updatePrefsState('detail', tps.toggleUseDetailsFlag(x)); |
Simon Hunt | ee7a3ce | 2015-04-09 13:28:37 -0700 | [diff] [blame] | 180 | } |
| 181 | |
Simon Hunt | fcbde89 | 2015-04-16 12:05:28 -0700 | [diff] [blame] | 182 | function toggleHosts(x) { |
| 183 | updatePrefsState('hosts', tfs.toggleHosts(x)); |
| 184 | } |
| 185 | |
| 186 | function toggleOffline(x) { |
| 187 | updatePrefsState('offdev', tfs.toggleOffline(x)); |
| 188 | } |
| 189 | |
| 190 | function togglePorts(x) { |
| 191 | updatePrefsState('porthl', tfs.togglePorts(x)); |
| 192 | } |
| 193 | |
| 194 | function _togSvgLayer(x, G, tag, what) { |
| 195 | var on = (x === 'keyev') ? !sus.visible(G) : !!x, |
Simon Hunt | 3f89cb4 | 2017-08-10 13:32:00 -0700 | [diff] [blame] | 196 | verb = on ? topoLion('show') : topoLion('hide'); |
Simon Hunt | fcbde89 | 2015-04-16 12:05:28 -0700 | [diff] [blame] | 197 | sus.visible(G, on); |
| 198 | updatePrefsState(tag, on); |
| 199 | flash.flash(verb + ' ' + what); |
| 200 | } |
| 201 | |
| 202 | function toggleMap(x) { |
Simon Hunt | 3f89cb4 | 2017-08-10 13:32:00 -0700 | [diff] [blame] | 203 | _togSvgLayer(x, mapG, 'bg', topoLion('fl_background_map')); |
Simon Hunt | ee7a3ce | 2015-04-09 13:28:37 -0700 | [diff] [blame] | 204 | } |
Simon Hunt | 36a58c6 | 2015-04-08 11:00:07 -0700 | [diff] [blame] | 205 | |
Thomas Vachuska | 26be4f3 | 2016-03-31 01:10:27 -0700 | [diff] [blame] | 206 | function openMapSelection() { |
| 207 | tms.openMapSelection(); |
| 208 | } |
| 209 | |
Simon Hunt | 2052e5d | 2015-04-13 17:40:44 -0700 | [diff] [blame] | 210 | function toggleSprites(x) { |
Simon Hunt | 3f89cb4 | 2017-08-10 13:32:00 -0700 | [diff] [blame] | 211 | _togSvgLayer(x, spriteG, 'spr', topoLion('fl_sprite_layer')); |
Simon Hunt | 2052e5d | 2015-04-13 17:40:44 -0700 | [diff] [blame] | 212 | } |
| 213 | |
Simon Hunt | 08f841d0 | 2015-02-10 14:39:20 -0800 | [diff] [blame] | 214 | function resetZoom() { |
| 215 | zoomer.reset(); |
Simon Hunt | 3f89cb4 | 2017-08-10 13:32:00 -0700 | [diff] [blame] | 216 | flash.flash(topoLion('fl_pan_zoom_reset')); |
Simon Hunt | 08f841d0 | 2015-02-10 14:39:20 -0800 | [diff] [blame] | 217 | } |
| 218 | |
Simon Hunt | 0e48c29 | 2015-02-19 16:11:37 -0800 | [diff] [blame] | 219 | function equalizeMasters() { |
Simon Hunt | 237676b5 | 2015-03-10 19:04:26 -0700 | [diff] [blame] | 220 | wss.sendEvent('equalizeMasters'); |
Simon Hunt | 3f89cb4 | 2017-08-10 13:32:00 -0700 | [diff] [blame] | 221 | flash.flash(topoLion('fl_eq_masters')); |
Simon Hunt | 0e48c29 | 2015-02-19 16:11:37 -0800 | [diff] [blame] | 222 | } |
| 223 | |
Simon Hunt | 08f841d0 | 2015-02-10 14:39:20 -0800 | [diff] [blame] | 224 | function handleEscape() { |
Simon Hunt | a142dd2 | 2015-02-12 22:07:51 -0800 | [diff] [blame] | 225 | if (tis.showMaster()) { |
| 226 | // if an instance is selected, cancel the affinity mapping |
Steven Burrows | 1c2a968 | 2017-07-14 16:52:46 +0100 | [diff] [blame] | 227 | tis.cancelAffinity(); |
Simon Hunt | 08f841d0 | 2015-02-10 14:39:20 -0800 | [diff] [blame] | 228 | |
Simon Hunt | 8d22c4b | 2015-08-06 16:24:43 -0700 | [diff] [blame] | 229 | } else if (tov.hooks.escape()) { |
| 230 | // else if the overlay consumed the ESC event... |
| 231 | // (work already done) |
| 232 | |
Simon Hunt | 0c6b2d3 | 2015-03-26 17:46:29 -0700 | [diff] [blame] | 233 | } else if (tss.deselectAll()) { |
Simon Hunt | a0eb0a8 | 2015-02-11 12:30:06 -0800 | [diff] [blame] | 234 | // else if we have node selections, deselect them all |
Simon Hunt | 0c6b2d3 | 2015-03-26 17:46:29 -0700 | [diff] [blame] | 235 | // (work already done) |
| 236 | |
Prince Pereira | 46c82d4 | 2016-09-19 13:30:50 +0530 | [diff] [blame] | 237 | } else if (tls.deselectAllLinks()) { |
Simon Hunt | 0c6b2d3 | 2015-03-26 17:46:29 -0700 | [diff] [blame] | 238 | // else if we have a link selected, deselect it |
| 239 | // (work already done) |
Simon Hunt | 08f841d0 | 2015-02-10 14:39:20 -0800 | [diff] [blame] | 240 | |
Simon Hunt | a0eb0a8 | 2015-02-11 12:30:06 -0800 | [diff] [blame] | 241 | } else if (tis.isVisible()) { |
| 242 | // else if the Instance Panel is visible, hide it |
| 243 | tis.hide(); |
| 244 | tfs.updateDeviceColors(); |
Simon Hunt | 08f841d0 | 2015-02-10 14:39:20 -0800 | [diff] [blame] | 245 | |
Simon Hunt | a0eb0a8 | 2015-02-11 12:30:06 -0800 | [diff] [blame] | 246 | } else if (tps.summaryVisible()) { |
| 247 | // else if the Summary Panel is visible, hide it |
Simon Hunt | 356da76 | 2016-05-27 11:54:02 -0700 | [diff] [blame] | 248 | tps.hideSummary(); |
Simon Hunt | a0eb0a8 | 2015-02-11 12:30:06 -0800 | [diff] [blame] | 249 | } |
Simon Hunt | 08f841d0 | 2015-02-10 14:39:20 -0800 | [diff] [blame] | 250 | } |
Simon Hunt | cacce34 | 2015-01-07 16:13:05 -0800 | [diff] [blame] | 251 | |
Bri Prebilic Cole | 4db8dce | 2015-03-18 13:57:24 -0700 | [diff] [blame] | 252 | // --- Toolbar Functions --------------------------------------------- |
| 253 | |
Bri Prebilic Cole | 2efc715 | 2015-04-29 15:47:06 -0700 | [diff] [blame] | 254 | function notValid(what) { |
Simon Hunt | 8d22c4b | 2015-08-06 16:24:43 -0700 | [diff] [blame] | 255 | $log.warn('topo.js getActionEntry(): Not a valid ' + what); |
Bri Prebilic Cole | 2efc715 | 2015-04-29 15:47:06 -0700 | [diff] [blame] | 256 | } |
Simon Hunt | 8d22c4b | 2015-08-06 16:24:43 -0700 | [diff] [blame] | 257 | |
Bri Prebilic Cole | 4db8dce | 2015-03-18 13:57:24 -0700 | [diff] [blame] | 258 | function getActionEntry(key) { |
Bri Prebilic Cole | 2efc715 | 2015-04-29 15:47:06 -0700 | [diff] [blame] | 259 | var entry; |
| 260 | |
| 261 | if (!key) { |
| 262 | notValid('key'); |
| 263 | return null; |
| 264 | } |
| 265 | |
| 266 | entry = actionMap[key]; |
| 267 | |
| 268 | if (!entry) { |
| 269 | notValid('actionMap entry'); |
| 270 | return null; |
| 271 | } |
Bri Prebilic Cole | 4db8dce | 2015-03-18 13:57:24 -0700 | [diff] [blame] | 272 | return fs.isA(entry) || [entry, '']; |
| 273 | } |
| 274 | |
| 275 | function setUpToolbar() { |
| 276 | ttbs.init({ |
Simon Hunt | 8d22c4b | 2015-08-06 16:24:43 -0700 | [diff] [blame] | 277 | getActionEntry: getActionEntry, |
Steven Burrows | 1c2a968 | 2017-07-14 16:52:46 +0100 | [diff] [blame] | 278 | setUpKeys: setUpKeys, |
Bri Prebilic Cole | 4db8dce | 2015-03-18 13:57:24 -0700 | [diff] [blame] | 279 | }); |
| 280 | ttbs.createToolbar(); |
| 281 | } |
| 282 | |
Simon Hunt | cacce34 | 2015-01-07 16:13:05 -0800 | [diff] [blame] | 283 | // --- Glyphs, Icons, and the like ----------------------------------- |
| 284 | |
Simon Hunt | 6cc5369 | 2015-01-07 11:33:45 -0800 | [diff] [blame] | 285 | function setUpDefs() { |
Simon Hunt | cacce34 | 2015-01-07 16:13:05 -0800 | [diff] [blame] | 286 | defs = svg.append('defs'); |
Simon Hunt | 6cc5369 | 2015-01-07 11:33:45 -0800 | [diff] [blame] | 287 | gs.loadDefs(defs); |
Simon Hunt | 0ee2868 | 2015-02-12 20:48:11 -0800 | [diff] [blame] | 288 | sus.loadGlowDefs(defs); |
Simon Hunt | 6cc5369 | 2015-01-07 11:33:45 -0800 | [diff] [blame] | 289 | } |
| 290 | |
| 291 | |
Simon Hunt | cacce34 | 2015-01-07 16:13:05 -0800 | [diff] [blame] | 292 | // --- Pan and Zoom -------------------------------------------------- |
| 293 | |
| 294 | // zoom enabled predicate. ev is a D3 source event. |
| 295 | function zoomEnabled(ev) { |
Simon Hunt | d552ee9 | 2015-04-02 17:06:35 -0700 | [diff] [blame] | 296 | return fs.isMobile() || (ev.metaKey || ev.altKey); |
Simon Hunt | cacce34 | 2015-01-07 16:13:05 -0800 | [diff] [blame] | 297 | } |
| 298 | |
| 299 | function zoomCallback() { |
Simon Hunt | bb5e0d8 | 2015-04-16 14:25:46 -0700 | [diff] [blame] | 300 | var sc = zoomer.scale(), |
| 301 | tr = zoomer.translate(); |
| 302 | |
Steven Burrows | 1c2a968 | 2017-07-14 16:52:46 +0100 | [diff] [blame] | 303 | ps.setPrefs('topo_zoom', { tx: tr[0], ty: tr[1], sc: sc }); |
Simon Hunt | cacce34 | 2015-01-07 16:13:05 -0800 | [diff] [blame] | 304 | |
Simon Hunt | 0541fb8 | 2015-01-14 18:59:57 -0800 | [diff] [blame] | 305 | // keep the map lines constant width while zooming |
Simon Hunt | 737c89f | 2015-01-28 12:23:19 -0800 | [diff] [blame] | 306 | mapG.style('stroke-width', (2.0 / sc) + 'px'); |
Steven Burrows | f17f0ab | 2017-04-11 11:03:58 -0700 | [diff] [blame] | 307 | |
| 308 | tfs.setNodeScale(sc); |
Simon Hunt | cacce34 | 2015-01-07 16:13:05 -0800 | [diff] [blame] | 309 | } |
| 310 | |
| 311 | function setUpZoom() { |
Simon Hunt | a7b6a6b | 2015-01-13 19:53:09 -0800 | [diff] [blame] | 312 | zoomLayer = svg.append('g').attr('id', 'topo-zoomlayer'); |
Simon Hunt | cacce34 | 2015-01-07 16:13:05 -0800 | [diff] [blame] | 313 | zoomer = zs.createZoomer({ |
| 314 | svg: svg, |
| 315 | zoomLayer: zoomLayer, |
| 316 | zoomEnabled: zoomEnabled, |
Steven Burrows | 1c2a968 | 2017-07-14 16:52:46 +0100 | [diff] [blame] | 317 | zoomCallback: zoomCallback, |
Simon Hunt | cacce34 | 2015-01-07 16:13:05 -0800 | [diff] [blame] | 318 | }); |
| 319 | } |
| 320 | |
| 321 | |
Simon Hunt | 0541fb8 | 2015-01-14 18:59:57 -0800 | [diff] [blame] | 322 | // callback invoked when the SVG view has been resized.. |
Simon Hunt | 3a6eec0 | 2015-02-09 21:16:43 -0800 | [diff] [blame] | 323 | function svgResized(s) { |
| 324 | tfs.newDim([s.width, s.height]); |
Simon Hunt | 0541fb8 | 2015-01-14 18:59:57 -0800 | [diff] [blame] | 325 | } |
| 326 | |
Simon Hunt | a7b6a6b | 2015-01-13 19:53:09 -0800 | [diff] [blame] | 327 | // --- Background Map ------------------------------------------------ |
| 328 | |
Simon Hunt | e2d9dc7 | 2017-08-10 15:21:04 -0700 | [diff] [blame] | 329 | function recenterLabel(g) { |
| 330 | var box = g.node().getBBox(); |
| 331 | |
| 332 | box.x -= box.width/2; |
| 333 | box.y -= box.height/2; |
| 334 | g.attr('transform', sus.translate(box.x, box.y)); |
Simon Hunt | e2d9dc7 | 2017-08-10 15:21:04 -0700 | [diff] [blame] | 335 | } |
| 336 | |
Simon Hunt | 7c8ab8d | 2015-02-03 15:05:15 -0800 | [diff] [blame] | 337 | function setUpNoDevs() { |
Simon Hunt | e2d9dc7 | 2017-08-10 15:21:04 -0700 | [diff] [blame] | 338 | var g; |
| 339 | |
Simon Hunt | 7c8ab8d | 2015-02-03 15:05:15 -0800 | [diff] [blame] | 340 | noDevsLayer = svg.append('g').attr({ |
| 341 | id: 'topo-noDevsLayer', |
Steven Burrows | 1c2a968 | 2017-07-14 16:52:46 +0100 | [diff] [blame] | 342 | transform: sus.translate(500, 500), |
Simon Hunt | 7c8ab8d | 2015-02-03 15:05:15 -0800 | [diff] [blame] | 343 | }); |
| 344 | // Note, SVG viewbox is '0 0 1000 1000', defined in topo.html. |
| 345 | // We are translating this layer to have its origin at the center |
| 346 | |
| 347 | g = noDevsLayer.append('g'); |
| 348 | gs.addGlyph(g, 'bird', 100).attr('class', 'noDevsBird'); |
Simon Hunt | caed041 | 2017-08-12 13:49:17 -0700 | [diff] [blame] | 349 | g.append('text').text('').attr({ x: 120, y: 80 }); |
Simon Hunt | e2d9dc7 | 2017-08-10 15:21:04 -0700 | [diff] [blame] | 350 | recenterLabel(g); |
Simon Hunt | 7c8ab8d | 2015-02-03 15:05:15 -0800 | [diff] [blame] | 351 | showNoDevs(true); |
| 352 | } |
| 353 | |
Simon Hunt | 3f89cb4 | 2017-08-10 13:32:00 -0700 | [diff] [blame] | 354 | function lionNoDevs() { |
Simon Hunt | e2d9dc7 | 2017-08-10 15:21:04 -0700 | [diff] [blame] | 355 | var g = d3.select('#topo-noDevsLayer g'); |
| 356 | |
| 357 | g.select('text').text(topoLion('no_devices_are_connected')); |
| 358 | recenterLabel(g); |
Simon Hunt | 3f89cb4 | 2017-08-10 13:32:00 -0700 | [diff] [blame] | 359 | } |
| 360 | |
Simon Hunt | 7c8ab8d | 2015-02-03 15:05:15 -0800 | [diff] [blame] | 361 | function showNoDevs(b) { |
Simon Hunt | 18bf982 | 2015-02-12 17:35:45 -0800 | [diff] [blame] | 362 | sus.visible(noDevsLayer, b); |
Simon Hunt | 7c8ab8d | 2015-02-03 15:05:15 -0800 | [diff] [blame] | 363 | } |
| 364 | |
Simon Hunt | 2362b07 | 2015-06-11 20:08:22 -0700 | [diff] [blame] | 365 | |
| 366 | var countryFilters = { |
Simon Hunt | 2362b07 | 2015-06-11 20:08:22 -0700 | [diff] [blame] | 367 | s_america: function (c) { |
| 368 | return c.properties.continent === 'South America'; |
| 369 | }, |
| 370 | |
Simon Hunt | ac099e8 | 2015-12-03 09:17:47 -0800 | [diff] [blame] | 371 | ns_america: function (c) { |
| 372 | return c.properties.custom === 'US-cont' || |
| 373 | c.properties.subregion === 'Central America' || |
Simon Hunt | d471262 | 2015-12-02 11:19:50 -0800 | [diff] [blame] | 374 | c.properties.continent === 'South America'; |
| 375 | }, |
| 376 | |
Simon Hunt | 2362b07 | 2015-06-11 20:08:22 -0700 | [diff] [blame] | 377 | japan: function (c) { |
| 378 | return c.properties.geounit === 'Japan'; |
| 379 | }, |
| 380 | |
| 381 | europe: function (c) { |
| 382 | return c.properties.continent === 'Europe'; |
| 383 | }, |
| 384 | |
| 385 | italy: function (c) { |
| 386 | return c.properties.geounit === 'Italy'; |
| 387 | }, |
| 388 | |
| 389 | uk: function (c) { |
| 390 | // technically, Ireland is not part of the United Kingdom, |
| 391 | // but the map looks weird without it showing. |
| 392 | return c.properties.adm0_a3 === 'GBR' || |
| 393 | c.properties.adm0_a3 === 'IRL'; |
Simon Hunt | 1178d5b | 2015-09-02 17:02:37 -0700 | [diff] [blame] | 394 | }, |
| 395 | |
| 396 | s_korea: function (c) { |
| 397 | return c.properties.adm0_a3 === 'KOR'; |
| 398 | }, |
| 399 | |
| 400 | australia: function (c) { |
| 401 | return c.properties.adm0_a3 === 'AUS'; |
Steven Burrows | 1c2a968 | 2017-07-14 16:52:46 +0100 | [diff] [blame] | 402 | }, |
Simon Hunt | 2362b07 | 2015-06-11 20:08:22 -0700 | [diff] [blame] | 403 | }; |
| 404 | |
Simon Hunt | a34fcb5 | 2016-02-25 16:27:32 -0800 | [diff] [blame] | 405 | var tintOn = 0, |
| 406 | shadeFlip = 0, |
| 407 | shadePalette = { |
| 408 | light: { |
| 409 | sea: 'aliceblue', |
| 410 | land: 'white', |
Steven Burrows | 1c2a968 | 2017-07-14 16:52:46 +0100 | [diff] [blame] | 411 | outline: '#ddd', |
Simon Hunt | a34fcb5 | 2016-02-25 16:27:32 -0800 | [diff] [blame] | 412 | }, |
| 413 | dark: { |
| 414 | sea: '#001830', |
| 415 | land: '#232331', |
Steven Burrows | 1c2a968 | 2017-07-14 16:52:46 +0100 | [diff] [blame] | 416 | outline: '#3a3a3a', |
| 417 | }, |
Simon Hunt | a34fcb5 | 2016-02-25 16:27:32 -0800 | [diff] [blame] | 418 | }; |
| 419 | |
| 420 | function shading() { |
| 421 | return tintOn ? { |
| 422 | palette: shadePalette[th.theme()], |
Steven Burrows | 1c2a968 | 2017-07-14 16:52:46 +0100 | [diff] [blame] | 423 | flip: shadeFlip, |
Simon Hunt | a34fcb5 | 2016-02-25 16:27:32 -0800 | [diff] [blame] | 424 | } : ''; |
| 425 | } |
Simon Hunt | 2362b07 | 2015-06-11 20:08:22 -0700 | [diff] [blame] | 426 | |
Thomas Vachuska | 26be4f3 | 2016-03-31 01:10:27 -0700 | [diff] [blame] | 427 | function setMap(map) { |
| 428 | ps.setPrefs('topo_mapid', map); |
Simon Hunt | 90053ed | 2016-04-06 12:49:02 -0700 | [diff] [blame] | 429 | setUpMap(); |
Thomas Vachuska | 26be4f3 | 2016-03-31 01:10:27 -0700 | [diff] [blame] | 430 | opacifyMap(true); |
| 431 | } |
| 432 | |
| 433 | function currentMap() { |
| 434 | return ps.getPrefs( |
| 435 | 'topo_mapid', |
Steven Burrows | 3a9a644 | 2016-05-05 15:31:16 +0100 | [diff] [blame] | 436 | { |
| 437 | mapid: 'usa', |
| 438 | mapscale: 1, |
| 439 | mapfilepath: '*continental_us', |
Steven Burrows | 1c2a968 | 2017-07-14 16:52:46 +0100 | [diff] [blame] | 440 | tint: 'off', |
Steven Burrows | 3a9a644 | 2016-05-05 15:31:16 +0100 | [diff] [blame] | 441 | }, |
Thomas Vachuska | 26be4f3 | 2016-03-31 01:10:27 -0700 | [diff] [blame] | 442 | $loc.search() |
| 443 | ); |
| 444 | } |
| 445 | |
Simon Hunt | 90053ed | 2016-04-06 12:49:02 -0700 | [diff] [blame] | 446 | function setUpMap() { |
Thomas Vachuska | 26be4f3 | 2016-03-31 01:10:27 -0700 | [diff] [blame] | 447 | var prefs = currentMap(), |
Simon Hunt | 8a119b0 | 2016-03-29 16:00:32 -0700 | [diff] [blame] | 448 | mapId = prefs.mapid, |
Steven Burrows | 3a9a644 | 2016-05-05 15:31:16 +0100 | [diff] [blame] | 449 | mapFilePath = prefs.mapfilepath, |
Simon Hunt | 8a119b0 | 2016-03-29 16:00:32 -0700 | [diff] [blame] | 450 | mapScale = prefs.mapscale, |
| 451 | tint = prefs.tint, |
Simon Hunt | 2362b07 | 2015-06-11 20:08:22 -0700 | [diff] [blame] | 452 | promise, |
Simon Hunt | facad99 | 2016-02-25 09:58:33 -0800 | [diff] [blame] | 453 | cfilter; |
Simon Hunt | 2362b07 | 2015-06-11 20:08:22 -0700 | [diff] [blame] | 454 | |
Simon Hunt | a34fcb5 | 2016-02-25 16:27:32 -0800 | [diff] [blame] | 455 | tintOn = tint === 'on' ? 1 : 0; |
| 456 | |
Simon Hunt | 1849136 | 2016-03-04 11:09:42 -0800 | [diff] [blame] | 457 | $log.debug('setUpMap() mapId:', mapId, ', mapScale:', mapScale, |
| 458 | ', tint:', tint); |
| 459 | |
Thomas Vachuska | 26be4f3 | 2016-03-31 01:10:27 -0700 | [diff] [blame] | 460 | mapG = d3.select('#topo-map'); |
| 461 | if (mapG.empty()) { |
| 462 | mapG = zoomLayer.append('g').attr('id', 'topo-map'); |
| 463 | } else { |
Steven Burrows | 1c2a968 | 2017-07-14 16:52:46 +0100 | [diff] [blame] | 464 | mapG.each(function (d, i) { |
Thomas Vachuska | 26be4f3 | 2016-03-31 01:10:27 -0700 | [diff] [blame] | 465 | d3.selectAll(this.childNodes).remove(); |
| 466 | }); |
| 467 | } |
Steven Burrows | 3a9a644 | 2016-05-05 15:31:16 +0100 | [diff] [blame] | 468 | |
| 469 | if (mapFilePath === '*countries') { |
| 470 | |
Simon Hunt | 90053ed | 2016-04-06 12:49:02 -0700 | [diff] [blame] | 471 | cfilter = countryFilters[mapId] || countryFilters.uk; |
Steven Burrows | 3a9a644 | 2016-05-05 15:31:16 +0100 | [diff] [blame] | 472 | |
Simon Hunt | a34fcb5 | 2016-02-25 16:27:32 -0800 | [diff] [blame] | 473 | promise = ms.loadMapRegionInto(mapG, { |
| 474 | countryFilter: cfilter, |
| 475 | adjustScale: mapScale, |
Steven Burrows | 1c2a968 | 2017-07-14 16:52:46 +0100 | [diff] [blame] | 476 | shading: shading(), |
Simon Hunt | a34fcb5 | 2016-02-25 16:27:32 -0800 | [diff] [blame] | 477 | }); |
Steven Burrows | 3a9a644 | 2016-05-05 15:31:16 +0100 | [diff] [blame] | 478 | } else { |
| 479 | |
| 480 | promise = ms.loadMapInto(mapG, mapFilePath, mapId, { |
| 481 | adjustScale: mapScale, |
Steven Burrows | 1c2a968 | 2017-07-14 16:52:46 +0100 | [diff] [blame] | 482 | shading: shading(), |
Steven Burrows | 3a9a644 | 2016-05-05 15:31:16 +0100 | [diff] [blame] | 483 | }); |
Simon Hunt | 2362b07 | 2015-06-11 20:08:22 -0700 | [diff] [blame] | 484 | } |
Steven Burrows | 3a9a644 | 2016-05-05 15:31:16 +0100 | [diff] [blame] | 485 | |
Simon Hunt | 8a119b0 | 2016-03-29 16:00:32 -0700 | [diff] [blame] | 486 | ps.setPrefs('topo_mapid', prefs); |
Simon Hunt | 2362b07 | 2015-06-11 20:08:22 -0700 | [diff] [blame] | 487 | return promise; |
Simon Hunt | 0541fb8 | 2015-01-14 18:59:57 -0800 | [diff] [blame] | 488 | } |
| 489 | |
Simon Hunt | f51bf46 | 2016-06-29 16:22:57 -0700 | [diff] [blame] | 490 | function mapReshader() { |
Steven Burrows | 1c2a968 | 2017-07-14 16:52:46 +0100 | [diff] [blame] | 491 | $log.debug('... Re-shading map ...'); |
Simon Hunt | f51bf46 | 2016-06-29 16:22:57 -0700 | [diff] [blame] | 492 | ms.reshade(shading()); |
| 493 | } |
| 494 | |
Simon Hunt | a34fcb5 | 2016-02-25 16:27:32 -0800 | [diff] [blame] | 495 | // set up theme listener to re-shade the map when required. |
| 496 | function mapShader(on) { |
| 497 | if (on) { |
Simon Hunt | f51bf46 | 2016-06-29 16:22:57 -0700 | [diff] [blame] | 498 | th.addListener(mapReshader); |
Simon Hunt | a34fcb5 | 2016-02-25 16:27:32 -0800 | [diff] [blame] | 499 | } else { |
Simon Hunt | f51bf46 | 2016-06-29 16:22:57 -0700 | [diff] [blame] | 500 | th.removeListener(mapReshader); |
Simon Hunt | a34fcb5 | 2016-02-25 16:27:32 -0800 | [diff] [blame] | 501 | } |
| 502 | } |
| 503 | |
Simon Hunt | c3c5b67 | 2015-02-20 11:32:13 -0800 | [diff] [blame] | 504 | function opacifyMap(b) { |
| 505 | mapG.transition() |
| 506 | .duration(1000) |
| 507 | .attr('opacity', b ? 1 : 0); |
| 508 | } |
Simon Hunt | 737c89f | 2015-01-28 12:23:19 -0800 | [diff] [blame] | 509 | |
Simon Hunt | 90053ed | 2016-04-06 12:49:02 -0700 | [diff] [blame] | 510 | function setUpSprites() { |
Simon Hunt | 8a119b0 | 2016-03-29 16:00:32 -0700 | [diff] [blame] | 511 | var prefs = ps.getPrefs('topo_sprites', { sprites: '' }, $loc.search()), |
| 512 | sprId = prefs.sprites; |
Simon Hunt | f9fc0e7 | 2015-04-16 15:10:57 -0700 | [diff] [blame] | 513 | |
Steven Burrows | 1c2a968 | 2017-07-14 16:52:46 +0100 | [diff] [blame] | 514 | spriteG = zoomLayer.append('g').attr('id', 'topo-sprites'); |
Simon Hunt | f9fc0e7 | 2015-04-16 15:10:57 -0700 | [diff] [blame] | 515 | if (sprId) { |
Simon Hunt | 8a119b0 | 2016-03-29 16:00:32 -0700 | [diff] [blame] | 516 | ps.setPrefs('topo_sprites', prefs); |
Simon Hunt | f9fc0e7 | 2015-04-16 15:10:57 -0700 | [diff] [blame] | 517 | tspr.loadSprites(spriteG, defs, sprId); |
| 518 | } |
| 519 | } |
Simon Hunt | 9c1c45e | 2015-04-10 13:38:27 -0700 | [diff] [blame] | 520 | |
Simon Hunt | c7ae795 | 2015-04-08 18:59:27 -0700 | [diff] [blame] | 521 | // --- User Preferemces ---------------------------------------------- |
Simon Hunt | 36a58c6 | 2015-04-08 11:00:07 -0700 | [diff] [blame] | 522 | |
Simon Hunt | c7ae795 | 2015-04-08 18:59:27 -0700 | [diff] [blame] | 523 | var prefsState = {}; |
Simon Hunt | 36a58c6 | 2015-04-08 11:00:07 -0700 | [diff] [blame] | 524 | |
Simon Hunt | c7ae795 | 2015-04-08 18:59:27 -0700 | [diff] [blame] | 525 | function updatePrefsState(what, b) { |
| 526 | prefsState[what] = b ? 1 : 0; |
| 527 | ps.setPrefs('topo_prefs', prefsState); |
Simon Hunt | 36a58c6 | 2015-04-08 11:00:07 -0700 | [diff] [blame] | 528 | } |
| 529 | |
Thomas Vachuska | c616e17 | 2018-04-17 16:57:12 -0700 | [diff] [blame] | 530 | function applyPreferences(evt) { |
Thomas Vachuska | e4a75a1 | 2018-04-20 15:44:17 -0700 | [diff] [blame] | 531 | // var zoomPrefs = ps.getPrefs('topo_zoom', null); |
Thomas Vachuska | bf5d1fe | 2018-04-25 15:49:00 -0400 | [diff] [blame] | 532 | // if (ps.getPrefs('topo_prefs', null)) { |
| 533 | // restoreConfigFromPrefs(); |
| 534 | // } |
Thomas Vachuska | e4a75a1 | 2018-04-20 15:44:17 -0700 | [diff] [blame] | 535 | // if (zoomPrefs) { |
| 536 | // $log.debug('TOPO- Zoom State:', zoomPrefs); |
| 537 | // zoomer.panZoom([zoomPrefs.tx, zoomPrefs.ty], zoomPrefs.sc, 100); |
| 538 | // } |
Thomas Vachuska | c616e17 | 2018-04-17 16:57:12 -0700 | [diff] [blame] | 539 | } |
Simon Hunt | 36a58c6 | 2015-04-08 11:00:07 -0700 | [diff] [blame] | 540 | |
Simon Hunt | c7ae795 | 2015-04-08 18:59:27 -0700 | [diff] [blame] | 541 | function restoreConfigFromPrefs() { |
| 542 | // NOTE: toolbar will have set this for us.. |
Simon Hunt | fc5c584 | 2017-02-01 23:32:18 -0800 | [diff] [blame] | 543 | prefsState = ps.asNumbers( |
| 544 | ps.getPrefs('topo_prefs', ttbs.defaultPrefs), ['ovid'], true |
| 545 | ); |
Simon Hunt | 36a58c6 | 2015-04-08 11:00:07 -0700 | [diff] [blame] | 546 | |
Simon Hunt | e1ce429 | 2015-06-12 13:07:02 -0700 | [diff] [blame] | 547 | $log.debug('TOPO- Prefs State:', prefsState); |
Simon Hunt | c7ae795 | 2015-04-08 18:59:27 -0700 | [diff] [blame] | 548 | |
Simon Hunt | f41f309 | 2015-04-16 10:33:26 -0700 | [diff] [blame] | 549 | flash.enable(false); |
Simon Hunt | c7ae795 | 2015-04-08 18:59:27 -0700 | [diff] [blame] | 550 | toggleInstances(prefsState.insts); |
Simon Hunt | ee7a3ce | 2015-04-09 13:28:37 -0700 | [diff] [blame] | 551 | toggleSummary(prefsState.summary); |
Simon Hunt | 239e588 | 2015-04-23 15:07:04 -0700 | [diff] [blame] | 552 | toggleUseDetailsFlag(prefsState.detail); |
Bri Prebilic Cole | 9b80ca0 | 2015-08-03 11:26:54 -0700 | [diff] [blame] | 553 | toggleHosts(prefsState.hosts); |
| 554 | toggleOffline(prefsState.offdev); |
| 555 | togglePorts(prefsState.porthl); |
| 556 | toggleMap(prefsState.bg); |
Simon Hunt | f9fc0e7 | 2015-04-16 15:10:57 -0700 | [diff] [blame] | 557 | toggleSprites(prefsState.spr); |
Thomas Vachuska | c616e17 | 2018-04-17 16:57:12 -0700 | [diff] [blame] | 558 | ttbs.setToolbar(prefsState.toolbar); |
Thomas Vachuska | 0af2691 | 2016-03-21 21:37:30 -0700 | [diff] [blame] | 559 | t3s.setDevLabIndex(prefsState.dlbls); |
Simon Hunt | 10618f6 | 2017-06-15 19:30:52 -0700 | [diff] [blame] | 560 | t3s.setHostLabIndex(prefsState.hlbls); |
Simon Hunt | f41f309 | 2015-04-16 10:33:26 -0700 | [diff] [blame] | 561 | flash.enable(true); |
Simon Hunt | 36a58c6 | 2015-04-08 11:00:07 -0700 | [diff] [blame] | 562 | } |
| 563 | |
| 564 | |
Simon Hunt | e1ce429 | 2015-06-12 13:07:02 -0700 | [diff] [blame] | 565 | // somewhat hackish, because summary update cannot happen until we |
| 566 | // have opened the websocket to the server; hence this extra function |
| 567 | // invoked after tes.start() |
| 568 | function restoreSummaryFromPrefs() { |
Simon Hunt | fc5c584 | 2017-02-01 23:32:18 -0800 | [diff] [blame] | 569 | prefsState = ps.asNumbers( |
| 570 | ps.getPrefs('topo_prefs', ttbs.defaultPrefs), ['ovid'], true |
| 571 | ); |
Simon Hunt | e1ce429 | 2015-06-12 13:07:02 -0700 | [diff] [blame] | 572 | $log.debug('TOPO- Prefs SUMMARY State:', prefsState.summary); |
| 573 | |
| 574 | flash.enable(false); |
| 575 | toggleSummary(prefsState.summary); |
| 576 | flash.enable(true); |
| 577 | } |
| 578 | |
Simon Hunt | 8419efd | 2017-01-12 12:36:28 -0800 | [diff] [blame] | 579 | // initial set of topo events received, now do post-processing |
Simon Hunt | 4a6b54b | 2015-10-27 22:08:25 -0700 | [diff] [blame] | 580 | function topoStartDone() { |
Simon Hunt | 8419efd | 2017-01-12 12:36:28 -0800 | [diff] [blame] | 581 | // give a small delay before attempting to reselect node(s) and |
| 582 | // highlight elements, since they have to be re-added to the DOM first... |
Simon Hunt | 7faabd5 | 2016-08-18 16:16:19 -0700 | [diff] [blame] | 583 | $timeout(function () { |
Simon Hunt | 8419efd | 2017-01-12 12:36:28 -0800 | [diff] [blame] | 584 | $log.debug('^^ topo.topoStartDone() ^^'); |
| 585 | |
| 586 | // reselect the previous selection... |
Simon Hunt | 7faabd5 | 2016-08-18 16:16:19 -0700 | [diff] [blame] | 587 | tss.reselect(); |
Simon Hunt | 8419efd | 2017-01-12 12:36:28 -0800 | [diff] [blame] | 588 | |
| 589 | // if an intent should be shown, invoke the appropriate callback |
| 590 | if ($scope.intentData) { |
Simon Hunt | 8419efd | 2017-01-12 12:36:28 -0800 | [diff] [blame] | 591 | tov.hooks.showIntent($scope.intentData); |
Simon Hunt | 7faabd5 | 2016-08-18 16:16:19 -0700 | [diff] [blame] | 592 | } |
Simon Hunt | 8419efd | 2017-01-12 12:36:28 -0800 | [diff] [blame] | 593 | |
Simon Hunt | 7faabd5 | 2016-08-18 16:16:19 -0700 | [diff] [blame] | 594 | }, 200); |
Simon Hunt | 4a6b54b | 2015-10-27 22:08:25 -0700 | [diff] [blame] | 595 | } |
Simon Hunt | e1ce429 | 2015-06-12 13:07:02 -0700 | [diff] [blame] | 596 | |
Simon Hunt | cacce34 | 2015-01-07 16:13:05 -0800 | [diff] [blame] | 597 | // --- Controller Definition ----------------------------------------- |
| 598 | |
Simon Hunt | 6cc5369 | 2015-01-07 11:33:45 -0800 | [diff] [blame] | 599 | angular.module('ovTopo', moduleDependencies) |
Simon Hunt | 5989ddf | 2017-08-02 20:38:12 -0700 | [diff] [blame] | 600 | .controller('OvTopoCtrl', |
| 601 | ['$scope', '$log', '$location', '$timeout', '$cookies', |
| 602 | 'FnService', 'MastService', 'KeyService', 'ZoomService', |
Simon Hunt | 0e48c29 | 2015-02-19 16:11:37 -0800 | [diff] [blame] | 603 | 'GlyphService', 'MapService', 'SvgUtilService', 'FlashService', |
Simon Hunt | a34fcb5 | 2016-02-25 16:27:32 -0800 | [diff] [blame] | 604 | 'WebSocketService', 'PrefsService', 'ThemeService', |
Simon Hunt | 5989ddf | 2017-08-02 20:38:12 -0700 | [diff] [blame] | 605 | 'TopoDialogService', 'TopoD3Service', 'TopoEventService', |
| 606 | 'TopoForceService', 'TopoPanelService', 'TopoInstService', |
| 607 | 'TopoSelectService', 'TopoLinkService', 'TopoTrafficService', |
| 608 | 'TopoObliqueService', 'TopoFilterService', 'TopoToolbarService', |
| 609 | 'TopoMapService', 'TopoSpriteService', 'TooltipService', |
| 610 | 'TopoOverlayService', 'LionService', |
Simon Hunt | 6cc5369 | 2015-01-07 11:33:45 -0800 | [diff] [blame] | 611 | |
Simon Hunt | 5989ddf | 2017-08-02 20:38:12 -0700 | [diff] [blame] | 612 | function (_$scope_, _$log_, _$loc_, _$timeout_, _$cookies_, |
| 613 | _fs_, mast, _ks_, _zs_, |
| 614 | _gs_, _ms_, _sus_, _flash_, |
| 615 | _wss_, _ps_, _th_, |
Thomas Vachuska | 0af2691 | 2016-03-21 21:37:30 -0700 | [diff] [blame] | 616 | _tds_, _t3s_, _tes_, |
Simon Hunt | 5989ddf | 2017-08-02 20:38:12 -0700 | [diff] [blame] | 617 | _tfs_, _tps_, _tis_, |
| 618 | _tss_, _tls_, _tts_, |
| 619 | _tos_, _fltr_, _ttbs_, |
| 620 | _tms_, _tspr_, _ttip_, |
| 621 | _tov_, lion) { |
Simon Hunt | fc5c584 | 2017-02-01 23:32:18 -0800 | [diff] [blame] | 622 | |
Thomas Vachuska | 26be4f3 | 2016-03-31 01:10:27 -0700 | [diff] [blame] | 623 | var params = _$loc_.search(), |
Simon Hunt | fc5c584 | 2017-02-01 23:32:18 -0800 | [diff] [blame] | 624 | selOverlay = params.overlayId, |
Simon Hunt | 4a6b54b | 2015-10-27 22:08:25 -0700 | [diff] [blame] | 625 | projection, |
Simon Hunt | 3a6eec0 | 2015-02-09 21:16:43 -0800 | [diff] [blame] | 626 | dim, |
Simon Hunt | 1894d79 | 2015-02-04 17:09:20 -0800 | [diff] [blame] | 627 | uplink = { |
| 628 | // provides function calls back into this space |
| 629 | showNoDevs: showNoDevs, |
| 630 | projection: function () { return projection; }, |
Simon Hunt | c3c5b67 | 2015-02-20 11:32:13 -0800 | [diff] [blame] | 631 | zoomLayer: function () { return zoomLayer; }, |
Simon Hunt | fb8ea1f | 2015-02-24 21:38:09 -0800 | [diff] [blame] | 632 | zoomer: function () { return zoomer; }, |
Simon Hunt | 4a6b54b | 2015-10-27 22:08:25 -0700 | [diff] [blame] | 633 | opacifyMap: opacifyMap, |
Steven Burrows | 1c2a968 | 2017-07-14 16:52:46 +0100 | [diff] [blame] | 634 | topoStartDone: topoStartDone, |
Simon Hunt | ac4c6f7 | 2015-02-03 19:50:53 -0800 | [diff] [blame] | 635 | }; |
| 636 | |
Bri Prebilic Cole | 068814d | 2015-05-14 16:06:38 -0700 | [diff] [blame] | 637 | $scope = _$scope_; |
Simon Hunt | 6cc5369 | 2015-01-07 11:33:45 -0800 | [diff] [blame] | 638 | $log = _$log_; |
Thomas Vachuska | 26be4f3 | 2016-03-31 01:10:27 -0700 | [diff] [blame] | 639 | $loc = _$loc_; |
Simon Hunt | 7faabd5 | 2016-08-18 16:16:19 -0700 | [diff] [blame] | 640 | $timeout = _$timeout_; |
Simon Hunt | a11b4eb | 2015-01-28 16:20:50 -0800 | [diff] [blame] | 641 | fs = _fs_; |
Simon Hunt | 6cc5369 | 2015-01-07 11:33:45 -0800 | [diff] [blame] | 642 | ks = _ks_; |
Simon Hunt | cacce34 | 2015-01-07 16:13:05 -0800 | [diff] [blame] | 643 | zs = _zs_; |
Simon Hunt | 6cc5369 | 2015-01-07 11:33:45 -0800 | [diff] [blame] | 644 | gs = _gs_; |
Simon Hunt | 1e8eff4 | 2015-01-08 17:19:02 -0800 | [diff] [blame] | 645 | ms = _ms_; |
Simon Hunt | 7c8ab8d | 2015-02-03 15:05:15 -0800 | [diff] [blame] | 646 | sus = _sus_; |
Simon Hunt | 0e48c29 | 2015-02-19 16:11:37 -0800 | [diff] [blame] | 647 | flash = _flash_; |
Simon Hunt | 237676b5 | 2015-03-10 19:04:26 -0700 | [diff] [blame] | 648 | wss = _wss_; |
Simon Hunt | c7ae795 | 2015-04-08 18:59:27 -0700 | [diff] [blame] | 649 | ps = _ps_; |
Simon Hunt | a34fcb5 | 2016-02-25 16:27:32 -0800 | [diff] [blame] | 650 | th = _th_; |
Simon Hunt | a211f7f | 2015-11-09 12:48:23 -0800 | [diff] [blame] | 651 | tds = _tds_; |
Thomas Vachuska | 0af2691 | 2016-03-21 21:37:30 -0700 | [diff] [blame] | 652 | t3s = _t3s_; |
Simon Hunt | c252aa6 | 2015-02-10 16:45:39 -0800 | [diff] [blame] | 653 | tes = _tes_; |
Simon Hunt | 737c89f | 2015-01-28 12:23:19 -0800 | [diff] [blame] | 654 | tfs = _tfs_; |
Simon Hunt | 96f88c6 | 2015-02-19 17:57:25 -0800 | [diff] [blame] | 655 | // TODO: consider funnelling actions through TopoForceService... |
| 656 | // rather than injecting references to these 'sub-modules', |
| 657 | // just so we can invoke functions on them. |
Simon Hunt | c252aa6 | 2015-02-10 16:45:39 -0800 | [diff] [blame] | 658 | tps = _tps_; |
Simon Hunt | ac4c6f7 | 2015-02-03 19:50:53 -0800 | [diff] [blame] | 659 | tis = _tis_; |
Thomas Vachuska | 26be4f3 | 2016-03-31 01:10:27 -0700 | [diff] [blame] | 660 | tms = _tms_; |
Simon Hunt | 0c6b2d3 | 2015-03-26 17:46:29 -0700 | [diff] [blame] | 661 | tls = _tls_; |
Simon Hunt | 96f88c6 | 2015-02-19 17:57:25 -0800 | [diff] [blame] | 662 | tos = _tos_; |
Bri Prebilic Cole | b5f2b15 | 2015-04-07 14:58:09 -0700 | [diff] [blame] | 663 | fltr = _fltr_; |
Bri Prebilic Cole | 4db8dce | 2015-03-18 13:57:24 -0700 | [diff] [blame] | 664 | ttbs = _ttbs_; |
Simon Hunt | a428124 | 2016-02-26 20:18:45 -0800 | [diff] [blame] | 665 | tspr = _tspr_; |
Simon Hunt | 72e44bf | 2015-07-21 21:34:20 -0700 | [diff] [blame] | 666 | tov = _tov_; |
Steven Burrows | 1c2a968 | 2017-07-14 16:52:46 +0100 | [diff] [blame] | 667 | tss = _tss_; |
Simon Hunt | ef31fb2 | 2014-12-19 13:16:44 -0800 | [diff] [blame] | 668 | |
Thomas Vachuska | 26be4f3 | 2016-03-31 01:10:27 -0700 | [diff] [blame] | 669 | tms.start({ |
| 670 | toggleMap: toggleMap, |
| 671 | currentMap: currentMap, |
Steven Burrows | 1c2a968 | 2017-07-14 16:52:46 +0100 | [diff] [blame] | 672 | setMap: setMap, |
Thomas Vachuska | 26be4f3 | 2016-03-31 01:10:27 -0700 | [diff] [blame] | 673 | }); |
| 674 | |
Simon Hunt | 441c9ae | 2017-02-03 18:22:31 -0800 | [diff] [blame] | 675 | // pull intent data from the query string... |
Viswanath KSP | 0f29770 | 2016-08-13 18:02:43 +0530 | [diff] [blame] | 676 | if (params.key && params.appId && params.appName) { |
Simon Hunt | 4a6b54b | 2015-10-27 22:08:25 -0700 | [diff] [blame] | 677 | $scope.intentData = { |
Viswanath KSP | 0f29770 | 2016-08-13 18:02:43 +0530 | [diff] [blame] | 678 | key: params.key, |
| 679 | appId: params.appId, |
Simon Hunt | 441c9ae | 2017-02-03 18:22:31 -0800 | [diff] [blame] | 680 | appName: params.appName, |
Steven Burrows | 1c2a968 | 2017-07-14 16:52:46 +0100 | [diff] [blame] | 681 | intentType: params.intentType, |
Simon Hunt | 4a6b54b | 2015-10-27 22:08:25 -0700 | [diff] [blame] | 682 | }; |
| 683 | } |
| 684 | |
Bri Prebilic Cole | 068814d | 2015-05-14 16:06:38 -0700 | [diff] [blame] | 685 | $scope.notifyResize = function () { |
Simon Hunt | b0ec1e5 | 2015-01-28 18:13:49 -0800 | [diff] [blame] | 686 | svgResized(fs.windowSize(mast.mastHeight())); |
Simon Hunt | 426bd86 | 2015-01-14 16:48:41 -0800 | [diff] [blame] | 687 | }; |
Simon Hunt | ef31fb2 | 2014-12-19 13:16:44 -0800 | [diff] [blame] | 688 | |
Simon Hunt | 54442fa | 2015-01-26 14:17:38 -0800 | [diff] [blame] | 689 | // Cleanup on destroyed scope.. |
Simon Hunt | 584122a | 2015-01-21 15:32:40 -0800 | [diff] [blame] | 690 | $scope.$on('$destroy', function () { |
| 691 | $log.log('OvTopoCtrl is saying Buh-Bye!'); |
Thomas Vachuska | 329af53 | 2015-03-10 02:08:33 -0700 | [diff] [blame] | 692 | tes.stop(); |
Thomas Vachuska | 26be4f3 | 2016-03-31 01:10:27 -0700 | [diff] [blame] | 693 | tms.stop(); |
Bri Prebilic Cole | 9dcaea5 | 2015-07-21 14:39:48 -0700 | [diff] [blame] | 694 | ks.unbindKeys(); |
Simon Hunt | 626d210 | 2015-01-29 11:54:50 -0800 | [diff] [blame] | 695 | tps.destroyPanels(); |
Simon Hunt | a211f7f | 2015-11-09 12:48:23 -0800 | [diff] [blame] | 696 | tds.closeDialog(); |
Simon Hunt | 4b66859 | 2015-01-29 17:33:53 -0800 | [diff] [blame] | 697 | tis.destroyInst(); |
Simon Hunt | 3a6eec0 | 2015-02-09 21:16:43 -0800 | [diff] [blame] | 698 | tfs.destroyForce(); |
Bri Prebilic Cole | d621905 | 2015-03-19 14:34:02 -0700 | [diff] [blame] | 699 | ttbs.destroyToolbar(); |
Simon Hunt | a34fcb5 | 2016-02-25 16:27:32 -0800 | [diff] [blame] | 700 | mapShader(false); |
Simon Hunt | 584122a | 2015-01-21 15:32:40 -0800 | [diff] [blame] | 701 | }); |
| 702 | |
Simon Hunt | cacce34 | 2015-01-07 16:13:05 -0800 | [diff] [blame] | 703 | // svg layer and initialization of components |
Simon Hunt | 426bd86 | 2015-01-14 16:48:41 -0800 | [diff] [blame] | 704 | ovtopo = d3.select('#ov-topo'); |
| 705 | svg = ovtopo.select('svg'); |
Simon Hunt | a11b4eb | 2015-01-28 16:20:50 -0800 | [diff] [blame] | 706 | // set the svg size to match that of the window, less the masthead |
| 707 | svg.attr(fs.windowSize(mast.mastHeight())); |
Simon Hunt | 3a6eec0 | 2015-02-09 21:16:43 -0800 | [diff] [blame] | 708 | dim = [svg.attr('width'), svg.attr('height')]; |
Simon Hunt | 426bd86 | 2015-01-14 16:48:41 -0800 | [diff] [blame] | 709 | |
Thomas Vachuska | c616e17 | 2018-04-17 16:57:12 -0700 | [diff] [blame] | 710 | ps.addListener(applyPreferences); |
| 711 | |
Simon Hunt | 6cc5369 | 2015-01-07 11:33:45 -0800 | [diff] [blame] | 712 | setUpKeys(); |
Bri Prebilic Cole | 4db8dce | 2015-03-18 13:57:24 -0700 | [diff] [blame] | 713 | setUpToolbar(); |
Simon Hunt | 6cc5369 | 2015-01-07 11:33:45 -0800 | [diff] [blame] | 714 | setUpDefs(); |
Simon Hunt | cacce34 | 2015-01-07 16:13:05 -0800 | [diff] [blame] | 715 | setUpZoom(); |
Simon Hunt | 7c8ab8d | 2015-02-03 15:05:15 -0800 | [diff] [blame] | 716 | setUpNoDevs(); |
Simon Hunt | 90053ed | 2016-04-06 12:49:02 -0700 | [diff] [blame] | 717 | setUpMap().then( |
Simon Hunt | 1894d79 | 2015-02-04 17:09:20 -0800 | [diff] [blame] | 718 | function (proj) { |
Steven Burrows | 1c2a968 | 2017-07-14 16:52:46 +0100 | [diff] [blame] | 719 | var z = ps.getPrefs('topo_zoom', { tx: 0, ty: 0, sc: 1 }); |
Simon Hunt | bb5e0d8 | 2015-04-16 14:25:46 -0700 | [diff] [blame] | 720 | zoomer.panZoom([z.tx, z.ty], z.sc); |
| 721 | $log.debug('** Zoom restored:', z); |
| 722 | |
Simon Hunt | 1894d79 | 2015-02-04 17:09:20 -0800 | [diff] [blame] | 723 | projection = proj; |
Simon Hunt | bb5e0d8 | 2015-04-16 14:25:46 -0700 | [diff] [blame] | 724 | $log.debug('** We installed the projection:', proj); |
Simon Hunt | f41f309 | 2015-04-16 10:33:26 -0700 | [diff] [blame] | 725 | flash.enable(false); |
Simon Hunt | c7ae795 | 2015-04-08 18:59:27 -0700 | [diff] [blame] | 726 | toggleMap(prefsState.bg); |
Simon Hunt | f41f309 | 2015-04-16 10:33:26 -0700 | [diff] [blame] | 727 | flash.enable(true); |
Simon Hunt | a34fcb5 | 2016-02-25 16:27:32 -0800 | [diff] [blame] | 728 | mapShader(true); |
Simon Hunt | e1ce429 | 2015-06-12 13:07:02 -0700 | [diff] [blame] | 729 | |
Simon Hunt | 5989ddf | 2017-08-02 20:38:12 -0700 | [diff] [blame] | 730 | // piggyback off the deferred map loading to load the |
| 731 | // localization bundle after the uber bundle has arrived... |
| 732 | $scope.lion = lion.bundle('core.view.Topo'); |
| 733 | topoLion = $scope.lion; |
| 734 | $log.debug('Loaded Topo LION Bundle:', topoLion); |
| 735 | |
Simon Hunt | 3f89cb4 | 2017-08-10 13:32:00 -0700 | [diff] [blame] | 736 | // insert localized text into already established |
| 737 | // DOM elements... |
| 738 | lionNoDevs(); |
| 739 | |
Simon Hunt | e2d9dc7 | 2017-08-10 15:21:04 -0700 | [diff] [blame] | 740 | // pass lion bundle function ref to other topo modules |
| 741 | tfs.setLionBundle(topoLion); |
| 742 | tis.setLionBundle(topoLion); |
Simon Hunt | 1603c69 | 2017-08-10 19:53:35 -0700 | [diff] [blame] | 743 | tms.setLionBundle(topoLion); |
Simon Hunt | 879ce45 | 2017-08-10 23:32:00 -0700 | [diff] [blame] | 744 | tps.setLionBundle(topoLion); |
Simon Hunt | caed041 | 2017-08-12 13:49:17 -0700 | [diff] [blame] | 745 | ttbs.setLionBundle(topoLion); |
Simon Hunt | e2d9dc7 | 2017-08-10 15:21:04 -0700 | [diff] [blame] | 746 | |
Simon Hunt | e1ce429 | 2015-06-12 13:07:02 -0700 | [diff] [blame] | 747 | // now we have the map projection, we are ready for |
| 748 | // the server to send us device/host data... |
| 749 | tes.start(); |
| 750 | // need to do the following so we immediately get |
| 751 | // the summary panel data back from the server |
| 752 | restoreSummaryFromPrefs(); |
Simon Hunt | 1894d79 | 2015-02-04 17:09:20 -0800 | [diff] [blame] | 753 | } |
| 754 | ); |
Simon Hunt | a428124 | 2016-02-26 20:18:45 -0800 | [diff] [blame] | 755 | tes.bindHandlers(); |
Simon Hunt | 90053ed | 2016-04-06 12:49:02 -0700 | [diff] [blame] | 756 | setUpSprites(); |
Simon Hunt | fd1231a | 2015-01-26 22:14:51 -0800 | [diff] [blame] | 757 | |
Simon Hunt | 1894d79 | 2015-02-04 17:09:20 -0800 | [diff] [blame] | 758 | forceG = zoomLayer.append('g').attr('id', 'topo-force'); |
Simon Hunt | fb8ea1f | 2015-02-24 21:38:09 -0800 | [diff] [blame] | 759 | tfs.initForce(svg, forceG, uplink, dim); |
Simon Hunt | a142dd2 | 2015-02-12 22:07:51 -0800 | [diff] [blame] | 760 | tis.initInst({ showMastership: tfs.showMastership }); |
Simon Hunt | 237676b5 | 2015-03-10 19:04:26 -0700 | [diff] [blame] | 761 | tps.initPanels(); |
Simon Hunt | 6cc5369 | 2015-01-07 11:33:45 -0800 | [diff] [blame] | 762 | |
Simon Hunt | c7ae795 | 2015-04-08 18:59:27 -0700 | [diff] [blame] | 763 | restoreConfigFromPrefs(); |
Simon Hunt | fc5c584 | 2017-02-01 23:32:18 -0800 | [diff] [blame] | 764 | |
| 765 | ttbs.selectOverlay(selOverlay || prefsState.ovid); |
Simon Hunt | 36a58c6 | 2015-04-08 11:00:07 -0700 | [diff] [blame] | 766 | |
Simon Hunt | 72e44bf | 2015-07-21 21:34:20 -0700 | [diff] [blame] | 767 | $log.debug('registered overlays...', tov.list()); |
Simon Hunt | 6cc5369 | 2015-01-07 11:33:45 -0800 | [diff] [blame] | 768 | $log.log('OvTopoCtrl has been created'); |
Simon Hunt | ef31fb2 | 2014-12-19 13:16:44 -0800 | [diff] [blame] | 769 | }]); |
| 770 | }()); |