Simon Hunt | 72e44bf | 2015-07-21 21:34:20 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2015 Open Networking Laboratory |
| 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 | /* |
| 19 | ONOS GUI -- Topology Overlay Module. |
| 20 | |
| 21 | Provides overlay capabilities, allowing ONOS apps to provide additional |
| 22 | custom data/behavior for the topology view. |
| 23 | |
| 24 | */ |
| 25 | |
| 26 | (function () { |
| 27 | 'use strict'; |
| 28 | |
| 29 | // constants |
| 30 | var tos = 'TopoOverlayService: '; |
| 31 | |
| 32 | // injected refs |
Simon Hunt | 8d22c4b | 2015-08-06 16:24:43 -0700 | [diff] [blame] | 33 | var $log, fs, gs, wss, ns, tss, tps, api; |
Simon Hunt | 72e44bf | 2015-07-21 21:34:20 -0700 | [diff] [blame] | 34 | |
| 35 | // internal state |
Simon Hunt | e05cae4 | 2015-07-23 17:35:24 -0700 | [diff] [blame] | 36 | var overlays = {}, |
| 37 | current = null; |
Simon Hunt | 72e44bf | 2015-07-21 21:34:20 -0700 | [diff] [blame] | 38 | |
| 39 | function error(fn, msg) { |
| 40 | $log.error(tos + fn + '(): ' + msg); |
| 41 | } |
| 42 | |
| 43 | function warn(fn, msg) { |
| 44 | $log.warn(tos + fn + '(): ' + msg); |
| 45 | } |
| 46 | |
Simon Hunt | fb94011 | 2015-07-29 18:36:35 -0700 | [diff] [blame] | 47 | function mkGlyphId(oid, gid) { |
| 48 | return (gid[0] === '*') ? oid + '-' + gid.slice(1) : gid; |
| 49 | } |
Simon Hunt | 72e44bf | 2015-07-21 21:34:20 -0700 | [diff] [blame] | 50 | |
Simon Hunt | fb94011 | 2015-07-29 18:36:35 -0700 | [diff] [blame] | 51 | function handleGlyphs(o) { |
| 52 | var gdata = fs.isO(o.glyphs), |
| 53 | oid = o.overlayId, |
| 54 | gid = o.glyphId || 'unknown', |
| 55 | data = {}, |
| 56 | note = []; |
| 57 | |
| 58 | o._glyphId = mkGlyphId(oid, gid); |
| 59 | |
| 60 | o.mkGid = function (g) { |
| 61 | return mkGlyphId(oid, g); |
| 62 | }; |
| 63 | o.mkId = function (s) { |
| 64 | return oid + '-' + s; |
| 65 | }; |
| 66 | |
| 67 | // process glyphs if defined |
| 68 | if (gdata) { |
| 69 | angular.forEach(gdata, function (value, key) { |
| 70 | var fullkey = oid + '-' + key; |
| 71 | data['_' + fullkey] = value.vb; |
| 72 | data[fullkey] = value.d; |
| 73 | note.push('*' + key); |
| 74 | }); |
| 75 | gs.registerGlyphs(data); |
| 76 | $log.debug('registered overlay glyphs:', oid, note); |
Simon Hunt | 72e44bf | 2015-07-21 21:34:20 -0700 | [diff] [blame] | 77 | } |
| 78 | } |
| 79 | |
| 80 | function register(overlay) { |
| 81 | var r = 'register', |
| 82 | over = fs.isO(overlay), |
Simon Hunt | 8d22c4b | 2015-08-06 16:24:43 -0700 | [diff] [blame] | 83 | kb = over ? fs.isO(overlay.keyBindings) : null, |
Simon Hunt | 72e44bf | 2015-07-21 21:34:20 -0700 | [diff] [blame] | 84 | id = over ? over.overlayId : ''; |
| 85 | |
| 86 | if (!id) { |
| 87 | return error(r, 'not a recognized overlay'); |
| 88 | } |
| 89 | if (overlays[id]) { |
| 90 | return warn(r, 'already registered: "' + id + '"'); |
| 91 | } |
| 92 | overlays[id] = overlay; |
Simon Hunt | fb94011 | 2015-07-29 18:36:35 -0700 | [diff] [blame] | 93 | handleGlyphs(overlay); |
Simon Hunt | 8d22c4b | 2015-08-06 16:24:43 -0700 | [diff] [blame] | 94 | |
| 95 | if (kb) { |
| 96 | if (!fs.isA(kb._keyOrder)) { |
| 97 | warn(r, 'no _keyOrder array defined on keyBindings'); |
| 98 | } else { |
| 99 | kb._keyOrder.forEach(function (k) { |
| 100 | if (k !== '-' && !kb[k]) { |
| 101 | warn(r, 'no "' + k + '" property defined on keyBindings'); |
| 102 | } |
| 103 | }); |
| 104 | } |
| 105 | } |
| 106 | |
Simon Hunt | 72e44bf | 2015-07-21 21:34:20 -0700 | [diff] [blame] | 107 | $log.debug(tos + 'registered overlay: ' + id, overlay); |
| 108 | } |
| 109 | |
Simon Hunt | 8d22c4b | 2015-08-06 16:24:43 -0700 | [diff] [blame] | 110 | // returns the list of overlay identifiers |
Simon Hunt | 72e44bf | 2015-07-21 21:34:20 -0700 | [diff] [blame] | 111 | function list() { |
| 112 | return d3.map(overlays).keys(); |
| 113 | } |
| 114 | |
Simon Hunt | 8d22c4b | 2015-08-06 16:24:43 -0700 | [diff] [blame] | 115 | // add a radio button for each registered overlay |
Simon Hunt | a5b53af | 2015-10-12 15:56:40 -0700 | [diff] [blame] | 116 | // return an overlay id to index map |
Simon Hunt | 8d22c4b | 2015-08-06 16:24:43 -0700 | [diff] [blame] | 117 | function augmentRbset(rset, switchFn) { |
Simon Hunt | a5b53af | 2015-10-12 15:56:40 -0700 | [diff] [blame] | 118 | var map = {}, |
| 119 | idx = 1; |
| 120 | |
Simon Hunt | 8d22c4b | 2015-08-06 16:24:43 -0700 | [diff] [blame] | 121 | angular.forEach(overlays, function (ov) { |
| 122 | rset.push({ |
| 123 | gid: ov._glyphId, |
| 124 | tooltip: (ov.tooltip || '(no tooltip)'), |
| 125 | cb: function () { |
| 126 | tbSelection(ov.overlayId, switchFn); |
| 127 | } |
| 128 | }); |
Simon Hunt | a5b53af | 2015-10-12 15:56:40 -0700 | [diff] [blame] | 129 | map[ov.overlayId] = idx++; |
Simon Hunt | 8d22c4b | 2015-08-06 16:24:43 -0700 | [diff] [blame] | 130 | }); |
Simon Hunt | a5b53af | 2015-10-12 15:56:40 -0700 | [diff] [blame] | 131 | return map; |
Simon Hunt | 72e44bf | 2015-07-21 21:34:20 -0700 | [diff] [blame] | 132 | } |
| 133 | |
Simon Hunt | e05cae4 | 2015-07-23 17:35:24 -0700 | [diff] [blame] | 134 | // an overlay was selected via toolbar radio button press from user |
Simon Hunt | 8d22c4b | 2015-08-06 16:24:43 -0700 | [diff] [blame] | 135 | function tbSelection(id, switchFn) { |
Simon Hunt | e05cae4 | 2015-07-23 17:35:24 -0700 | [diff] [blame] | 136 | var same = current && current.overlayId === id, |
Simon Hunt | 8d22c4b | 2015-08-06 16:24:43 -0700 | [diff] [blame] | 137 | payload = {}, |
| 138 | actions; |
Simon Hunt | e05cae4 | 2015-07-23 17:35:24 -0700 | [diff] [blame] | 139 | |
| 140 | function doop(op) { |
| 141 | var oid = current.overlayId; |
| 142 | $log.debug('Overlay:', op, oid); |
| 143 | current[op](); |
| 144 | payload[op] = oid; |
| 145 | } |
| 146 | |
| 147 | if (!same) { |
| 148 | current && doop('deactivate'); |
Simon Hunt | 8d22c4b | 2015-08-06 16:24:43 -0700 | [diff] [blame] | 149 | current = overlays[id]; |
Simon Hunt | e05cae4 | 2015-07-23 17:35:24 -0700 | [diff] [blame] | 150 | current && doop('activate'); |
Simon Hunt | 8d22c4b | 2015-08-06 16:24:43 -0700 | [diff] [blame] | 151 | actions = current && fs.isO(current.keyBindings); |
| 152 | switchFn(id, actions); |
| 153 | |
Simon Hunt | e05cae4 | 2015-07-23 17:35:24 -0700 | [diff] [blame] | 154 | wss.sendEvent('topoSelectOverlay', payload); |
Simon Hunt | 0af1ec3 | 2015-07-24 12:17:55 -0700 | [diff] [blame] | 155 | |
Simon Hunt | 8d22c4b | 2015-08-06 16:24:43 -0700 | [diff] [blame] | 156 | // Ensure summary and details panels are updated immediately.. |
Simon Hunt | 0af1ec3 | 2015-07-24 12:17:55 -0700 | [diff] [blame] | 157 | wss.sendEvent('requestSummary'); |
Simon Hunt | 8d22c4b | 2015-08-06 16:24:43 -0700 | [diff] [blame] | 158 | tss.updateDetail(); |
Simon Hunt | e05cae4 | 2015-07-23 17:35:24 -0700 | [diff] [blame] | 159 | } |
| 160 | } |
| 161 | |
Simon Hunt | 8d22c4b | 2015-08-06 16:24:43 -0700 | [diff] [blame] | 162 | var coreButtons = { |
| 163 | showDeviceView: { |
| 164 | gid: 'switch', |
| 165 | tt: 'Show Device View', |
| 166 | path: 'device' |
| 167 | }, |
| 168 | showFlowView: { |
| 169 | gid: 'flowTable', |
| 170 | tt: 'Show Flow View for this Device', |
| 171 | path: 'flow' |
| 172 | }, |
| 173 | showPortView: { |
| 174 | gid: 'portTable', |
| 175 | tt: 'Show Port View for this Device', |
| 176 | path: 'port' |
| 177 | }, |
| 178 | showGroupView: { |
| 179 | gid: 'groupTable', |
| 180 | tt: 'Show Group View for this Device', |
| 181 | path: 'group' |
| 182 | } |
Simon Hunt | 3a0598f | 2015-08-04 19:59:04 -0700 | [diff] [blame] | 183 | }; |
Simon Hunt | fb94011 | 2015-07-29 18:36:35 -0700 | [diff] [blame] | 184 | |
Simon Hunt | 8d22c4b | 2015-08-06 16:24:43 -0700 | [diff] [blame] | 185 | // retrieves a button definition from the current overlay and generates |
| 186 | // a button descriptor to be added to the panel, with the data baked in |
| 187 | function _getButtonDef(id, data) { |
| 188 | var btns = current && current.buttons, |
| 189 | b = btns && btns[id], |
| 190 | cb = fs.isF(b.cb), |
| 191 | f = cb ? function () { cb(data); } : function () {}; |
| 192 | |
| 193 | return b ? { |
| 194 | id: current.mkId(id), |
| 195 | gid: current.mkGid(b.gid), |
| 196 | tt: b.tt, |
| 197 | cb: f |
| 198 | } : null; |
| 199 | } |
| 200 | |
Simon Hunt | 3a0598f | 2015-08-04 19:59:04 -0700 | [diff] [blame] | 201 | // install core buttons, and include any additional from the current overlay |
Simon Hunt | 8d22c4b | 2015-08-06 16:24:43 -0700 | [diff] [blame] | 202 | function installButtons(buttons, data, devId) { |
| 203 | buttons.forEach(function (id) { |
| 204 | var btn = coreButtons[id], |
| 205 | gid = btn && btn.gid, |
| 206 | tt = btn && btn.tt, |
| 207 | path = btn && btn.path; |
Simon Hunt | 3a0598f | 2015-08-04 19:59:04 -0700 | [diff] [blame] | 208 | |
Simon Hunt | 8d22c4b | 2015-08-06 16:24:43 -0700 | [diff] [blame] | 209 | if (btn) { |
| 210 | tps.addAction({ |
| 211 | id: 'core-' + id, |
| 212 | gid: gid, |
| 213 | tt: tt, |
| 214 | cb: function () { ns.navTo(path, {devId: devId }); } |
| 215 | }); |
| 216 | } else if (btn = _getButtonDef(id, data)) { |
| 217 | tps.addAction(btn); |
Simon Hunt | 3a0598f | 2015-08-04 19:59:04 -0700 | [diff] [blame] | 218 | } |
Simon Hunt | 8d22c4b | 2015-08-06 16:24:43 -0700 | [diff] [blame] | 219 | }); |
| 220 | } |
Simon Hunt | 3a0598f | 2015-08-04 19:59:04 -0700 | [diff] [blame] | 221 | |
Simon Hunt | 8d22c4b | 2015-08-06 16:24:43 -0700 | [diff] [blame] | 222 | function addDetailButton(id) { |
| 223 | var b = _getButtonDef(id); |
| 224 | if (b) { |
| 225 | tps.addAction({ |
| 226 | id: current.mkId(id), |
| 227 | gid: current.mkGid(b.gid), |
| 228 | cb: b.cb, |
| 229 | tt: b.tt |
| 230 | }); |
| 231 | } |
| 232 | } |
Simon Hunt | 3a0598f | 2015-08-04 19:59:04 -0700 | [diff] [blame] | 233 | |
Simon Hunt | 8d22c4b | 2015-08-06 16:24:43 -0700 | [diff] [blame] | 234 | |
| 235 | // === ----------------------------------------------------- |
| 236 | // Hooks for overlays |
| 237 | |
| 238 | function _hook(x) { |
| 239 | var h = current && current.hooks; |
| 240 | return h && fs.isF(h[x]); |
| 241 | } |
| 242 | |
| 243 | function escapeHook() { |
| 244 | var eh = _hook('escape'); |
| 245 | return eh ? eh() : false; |
| 246 | } |
| 247 | |
| 248 | function emptySelectHook() { |
| 249 | var cb = _hook('empty'); |
| 250 | cb && cb(); |
| 251 | } |
| 252 | |
| 253 | function singleSelectHook(data) { |
| 254 | var cb = _hook('single'); |
| 255 | cb && cb(data); |
| 256 | } |
| 257 | |
| 258 | function multiSelectHook(selectOrder) { |
| 259 | var cb = _hook('multi'); |
| 260 | cb && cb(selectOrder); |
| 261 | } |
| 262 | |
Simon Hunt | 584e92d | 2015-08-24 11:27:22 -0700 | [diff] [blame] | 263 | function mouseOverHook(what) { |
| 264 | var cb = _hook('mouseover'); |
| 265 | cb && cb(what); |
| 266 | } |
| 267 | |
| 268 | function mouseOutHook() { |
| 269 | var cb = _hook('mouseout'); |
| 270 | cb && cb(); |
| 271 | } |
| 272 | |
Simon Hunt | 8d22c4b | 2015-08-06 16:24:43 -0700 | [diff] [blame] | 273 | // === ----------------------------------------------------- |
| 274 | // Event (from server) Handlers |
| 275 | |
| 276 | function setApi(_api_, _tss_) { |
| 277 | api = _api_; |
| 278 | tss = _tss_; |
| 279 | } |
| 280 | |
Simon Hunt | 8d22c4b | 2015-08-06 16:24:43 -0700 | [diff] [blame] | 281 | function showHighlights(data) { |
Simon Hunt | 743a849 | 2015-08-25 16:18:19 -0700 | [diff] [blame] | 282 | var less; |
| 283 | |
Simon Hunt | 8d22c4b | 2015-08-06 16:24:43 -0700 | [diff] [blame] | 284 | /* |
| 285 | API to topoForce |
| 286 | clearLinkTrafficStyle() |
| 287 | removeLinkLabels() |
Simon Hunt | 8d22c4b | 2015-08-06 16:24:43 -0700 | [diff] [blame] | 288 | findLinkById( id ) |
Simon Hunt | 94f7dae | 2015-08-26 17:40:59 -0700 | [diff] [blame] | 289 | findNodeById( id ) |
Simon Hunt | 743a849 | 2015-08-25 16:18:19 -0700 | [diff] [blame] | 290 | updateLinks() |
| 291 | updateNodes() |
| 292 | supLayers( bool, [less] ) |
| 293 | unsupNode( id, [less] ) |
Simon Hunt | 94f7dae | 2015-08-26 17:40:59 -0700 | [diff] [blame] | 294 | unsupLink( key, [less] ) |
Simon Hunt | 8d22c4b | 2015-08-06 16:24:43 -0700 | [diff] [blame] | 295 | */ |
| 296 | |
Simon Hunt | d3ceffa | 2015-08-25 12:44:35 -0700 | [diff] [blame] | 297 | // TODO: clear node highlighting |
Simon Hunt | 8d22c4b | 2015-08-06 16:24:43 -0700 | [diff] [blame] | 298 | api.clearLinkTrafficStyle(); |
| 299 | api.removeLinkLabels(); |
| 300 | |
Simon Hunt | 743a849 | 2015-08-25 16:18:19 -0700 | [diff] [blame] | 301 | // handle element suppression |
| 302 | if (data.subdue) { |
| 303 | less = data.subdue === 'min'; |
| 304 | api.supLayers(true, less); |
| 305 | |
| 306 | } else { |
| 307 | api.supLayers(false); |
| 308 | api.supLayers(false, true); |
| 309 | } |
| 310 | |
Simon Hunt | 94f7dae | 2015-08-26 17:40:59 -0700 | [diff] [blame] | 311 | data.hosts.forEach(function (host) { |
| 312 | var hdata = api.findNodeById(host.id); |
| 313 | if (hdata && !hdata.el.empty()) { |
Simon Hunt | 5b3ff90 | 2015-08-27 09:46:27 -0700 | [diff] [blame] | 314 | if (!host.subdue) { |
| 315 | api.unsupNode(hdata.id, less); |
| 316 | } |
Simon Hunt | 94f7dae | 2015-08-26 17:40:59 -0700 | [diff] [blame] | 317 | // TODO: further highlighting? |
| 318 | } |
| 319 | }); |
Simon Hunt | 8d22c4b | 2015-08-06 16:24:43 -0700 | [diff] [blame] | 320 | |
Simon Hunt | 94f7dae | 2015-08-26 17:40:59 -0700 | [diff] [blame] | 321 | data.devices.forEach(function (device) { |
| 322 | var ddata = api.findNodeById(device.id); |
| 323 | if (ddata && !ddata.el.empty()) { |
Simon Hunt | 5b3ff90 | 2015-08-27 09:46:27 -0700 | [diff] [blame] | 324 | if (!device.subdue) { |
| 325 | api.unsupNode(ddata.id, less); |
| 326 | } |
Simon Hunt | 94f7dae | 2015-08-26 17:40:59 -0700 | [diff] [blame] | 327 | // TODO: further highlighting? |
| 328 | } |
| 329 | }); |
| 330 | |
| 331 | data.links.forEach(function (link) { |
| 332 | var ldata = api.findLinkById(link.id), |
| 333 | lab = link.label, |
Simon Hunt | d3ceffa | 2015-08-25 12:44:35 -0700 | [diff] [blame] | 334 | units, portcls, magnitude; |
Simon Hunt | 8d22c4b | 2015-08-06 16:24:43 -0700 | [diff] [blame] | 335 | |
Simon Hunt | d3ceffa | 2015-08-25 12:44:35 -0700 | [diff] [blame] | 336 | if (ldata && !ldata.el.empty()) { |
Simon Hunt | 5b3ff90 | 2015-08-27 09:46:27 -0700 | [diff] [blame] | 337 | if (!link.subdue) { |
| 338 | api.unsupLink(ldata.key, less); |
| 339 | } |
Simon Hunt | 94f7dae | 2015-08-26 17:40:59 -0700 | [diff] [blame] | 340 | ldata.el.classed(link.css, true); |
Simon Hunt | d3ceffa | 2015-08-25 12:44:35 -0700 | [diff] [blame] | 341 | ldata.label = lab; |
Simon Hunt | 8d22c4b | 2015-08-06 16:24:43 -0700 | [diff] [blame] | 342 | |
Simon Hunt | 5b3ff90 | 2015-08-27 09:46:27 -0700 | [diff] [blame] | 343 | // TODO: this needs to be pulled out into traffic overlay |
Simon Hunt | d3ceffa | 2015-08-25 12:44:35 -0700 | [diff] [blame] | 344 | // inject additional styling for port-based traffic |
| 345 | if (fs.endsWith(lab, 'bps')) { |
| 346 | units = lab.substring(lab.length-4); |
| 347 | portcls = 'port-traffic-' + units; |
Simon Hunt | 8d22c4b | 2015-08-06 16:24:43 -0700 | [diff] [blame] | 348 | |
Simon Hunt | d3ceffa | 2015-08-25 12:44:35 -0700 | [diff] [blame] | 349 | // for GBps |
| 350 | if (units.substring(0,1) === 'G') { |
| 351 | magnitude = fs.parseBitRate(lab); |
| 352 | if (magnitude >= 9) { |
| 353 | portcls += '-choked' |
Simon Hunt | 8d22c4b | 2015-08-06 16:24:43 -0700 | [diff] [blame] | 354 | } |
Simon Hunt | 8d22c4b | 2015-08-06 16:24:43 -0700 | [diff] [blame] | 355 | } |
Simon Hunt | d3ceffa | 2015-08-25 12:44:35 -0700 | [diff] [blame] | 356 | ldata.el.classed(portcls, true); |
Simon Hunt | 8d22c4b | 2015-08-06 16:24:43 -0700 | [diff] [blame] | 357 | } |
| 358 | } |
Simon Hunt | 3a0598f | 2015-08-04 19:59:04 -0700 | [diff] [blame] | 359 | }); |
Simon Hunt | fb94011 | 2015-07-29 18:36:35 -0700 | [diff] [blame] | 360 | |
Simon Hunt | 743a849 | 2015-08-25 16:18:19 -0700 | [diff] [blame] | 361 | api.updateNodes(); |
Simon Hunt | 8d22c4b | 2015-08-06 16:24:43 -0700 | [diff] [blame] | 362 | api.updateLinks(); |
Simon Hunt | fb94011 | 2015-07-29 18:36:35 -0700 | [diff] [blame] | 363 | } |
| 364 | |
Simon Hunt | 8d22c4b | 2015-08-06 16:24:43 -0700 | [diff] [blame] | 365 | // ======================================================================== |
| 366 | |
Simon Hunt | 72e44bf | 2015-07-21 21:34:20 -0700 | [diff] [blame] | 367 | angular.module('ovTopo') |
| 368 | .factory('TopoOverlayService', |
Simon Hunt | 3a0598f | 2015-08-04 19:59:04 -0700 | [diff] [blame] | 369 | ['$log', 'FnService', 'GlyphService', 'WebSocketService', 'NavService', |
Simon Hunt | 8d22c4b | 2015-08-06 16:24:43 -0700 | [diff] [blame] | 370 | 'TopoPanelService', |
Simon Hunt | 72e44bf | 2015-07-21 21:34:20 -0700 | [diff] [blame] | 371 | |
Simon Hunt | 8d22c4b | 2015-08-06 16:24:43 -0700 | [diff] [blame] | 372 | function (_$log_, _fs_, _gs_, _wss_, _ns_, _tps_) { |
Simon Hunt | 72e44bf | 2015-07-21 21:34:20 -0700 | [diff] [blame] | 373 | $log = _$log_; |
| 374 | fs = _fs_; |
| 375 | gs = _gs_; |
Simon Hunt | e05cae4 | 2015-07-23 17:35:24 -0700 | [diff] [blame] | 376 | wss = _wss_; |
Simon Hunt | 3a0598f | 2015-08-04 19:59:04 -0700 | [diff] [blame] | 377 | ns = _ns_; |
Simon Hunt | 8d22c4b | 2015-08-06 16:24:43 -0700 | [diff] [blame] | 378 | tps = _tps_; |
Simon Hunt | 72e44bf | 2015-07-21 21:34:20 -0700 | [diff] [blame] | 379 | |
| 380 | return { |
| 381 | register: register, |
Simon Hunt | 8d22c4b | 2015-08-06 16:24:43 -0700 | [diff] [blame] | 382 | setApi: setApi, |
Simon Hunt | 72e44bf | 2015-07-21 21:34:20 -0700 | [diff] [blame] | 383 | list: list, |
Simon Hunt | 8d22c4b | 2015-08-06 16:24:43 -0700 | [diff] [blame] | 384 | augmentRbset: augmentRbset, |
| 385 | mkGlyphId: mkGlyphId, |
Simon Hunt | fb94011 | 2015-07-29 18:36:35 -0700 | [diff] [blame] | 386 | tbSelection: tbSelection, |
Simon Hunt | 8d22c4b | 2015-08-06 16:24:43 -0700 | [diff] [blame] | 387 | installButtons: installButtons, |
| 388 | addDetailButton: addDetailButton, |
| 389 | hooks: { |
| 390 | escape: escapeHook, |
| 391 | emptySelect: emptySelectHook, |
| 392 | singleSelect: singleSelectHook, |
Simon Hunt | 584e92d | 2015-08-24 11:27:22 -0700 | [diff] [blame] | 393 | multiSelect: multiSelectHook, |
| 394 | mouseOver: mouseOverHook, |
| 395 | mouseOut: mouseOutHook |
Simon Hunt | 8d22c4b | 2015-08-06 16:24:43 -0700 | [diff] [blame] | 396 | }, |
| 397 | |
| 398 | showHighlights: showHighlights |
Simon Hunt | 72e44bf | 2015-07-21 21:34:20 -0700 | [diff] [blame] | 399 | } |
| 400 | }]); |
| 401 | |
| 402 | }()); |