Bri Prebilic Cole | 4db8dce | 2015-03-18 13:57:24 -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 | ONOS GUI -- Topology Toolbar Module. |
Simon Hunt | 0906014 | 2015-03-18 20:23:32 -0700 | [diff] [blame] | 19 | Functions for creating and interacting with the toolbar. |
Bri Prebilic Cole | 4db8dce | 2015-03-18 13:57:24 -0700 | [diff] [blame] | 20 | */ |
| 21 | |
| 22 | (function () { |
Bri Prebilic Cole | 54d0938 | 2015-03-19 18:40:27 -0700 | [diff] [blame] | 23 | 'use strict'; |
Bri Prebilic Cole | 4db8dce | 2015-03-18 13:57:24 -0700 | [diff] [blame] | 24 | |
| 25 | // injected references |
Simon Hunt | a211f7f | 2015-11-09 12:48:23 -0800 | [diff] [blame] | 26 | var $log, fs, tbs, ps, tov, tds, api; |
Bri Prebilic Cole | 4db8dce | 2015-03-18 13:57:24 -0700 | [diff] [blame] | 27 | |
Simon Hunt | 8d22c4b | 2015-08-06 16:24:43 -0700 | [diff] [blame] | 28 | // API: |
| 29 | // getActionEntry |
| 30 | // setUpKeys |
| 31 | |
Simon Hunt | 0906014 | 2015-03-18 20:23:32 -0700 | [diff] [blame] | 32 | // internal state |
Simon Hunt | a5b53af | 2015-10-12 15:56:40 -0700 | [diff] [blame] | 33 | var toolbar, keyData, cachedState, thirdRow, ovRset, ovIndex; |
Bri Prebilic Cole | 4db8dce | 2015-03-18 13:57:24 -0700 | [diff] [blame] | 34 | |
Bri Prebilic Cole | d621905 | 2015-03-19 14:34:02 -0700 | [diff] [blame] | 35 | // constants |
Simon Hunt | c7ae795 | 2015-04-08 18:59:27 -0700 | [diff] [blame] | 36 | var name = 'topo-tbar', |
Simon Hunt | 8d22c4b | 2015-08-06 16:24:43 -0700 | [diff] [blame] | 37 | cooktag = 'topo_prefs', |
| 38 | soa = 'switchOverlayActions: ', |
Simon Hunt | a5b53af | 2015-10-12 15:56:40 -0700 | [diff] [blame] | 39 | selOver = 'Select overlay here ⇧', |
| 40 | defaultOverlay = 'traffic'; |
Simon Hunt | 8d22c4b | 2015-08-06 16:24:43 -0700 | [diff] [blame] | 41 | |
Bri Prebilic Cole | d621905 | 2015-03-19 14:34:02 -0700 | [diff] [blame] | 42 | |
Simon Hunt | 0906014 | 2015-03-18 20:23:32 -0700 | [diff] [blame] | 43 | // key to button mapping data |
| 44 | var k2b = { |
Bri Prebilic Cole | deca6e9 | 2015-03-19 12:03:14 -0700 | [diff] [blame] | 45 | O: { id: 'summary-tog', gid: 'summary', isel: true}, |
Simon Hunt | 0906014 | 2015-03-18 20:23:32 -0700 | [diff] [blame] | 46 | I: { id: 'instance-tog', gid: 'uiAttached', isel: true }, |
Bri Prebilic Cole | deca6e9 | 2015-03-19 12:03:14 -0700 | [diff] [blame] | 47 | D: { id: 'details-tog', gid: 'details', isel: true }, |
Simon Hunt | 0906014 | 2015-03-18 20:23:32 -0700 | [diff] [blame] | 48 | H: { id: 'hosts-tog', gid: 'endstation', isel: false }, |
| 49 | M: { id: 'offline-tog', gid: 'switch', isel: true }, |
Bri Prebilic Cole | deca6e9 | 2015-03-19 12:03:14 -0700 | [diff] [blame] | 50 | P: { id: 'ports-tog', gid: 'ports', isel: true }, |
Simon Hunt | d0fe66c | 2015-06-10 10:16:36 -0700 | [diff] [blame] | 51 | B: { id: 'bkgrnd-tog', gid: 'map', isel: false }, |
Simon Hunt | 2052e5d | 2015-04-13 17:40:44 -0700 | [diff] [blame] | 52 | S: { id: 'sprite-tog', gid: 'cloud', isel: false }, |
Bri Prebilic Cole | 812f6c0 | 2015-03-24 17:10:33 -0700 | [diff] [blame] | 53 | |
| 54 | //X: { id: 'nodelock-tog', gid: 'lock', isel: false }, |
| 55 | Z: { id: 'oblique-tog', gid: 'oblique', isel: false }, |
Bri Prebilic Cole | b5f2b15 | 2015-04-07 14:58:09 -0700 | [diff] [blame] | 56 | N: { id: 'filters-btn', gid: 'filters' }, |
Bri Prebilic Cole | 812f6c0 | 2015-03-24 17:10:33 -0700 | [diff] [blame] | 57 | L: { id: 'cycleLabels-btn', gid: 'cycleLabels' }, |
| 58 | R: { id: 'resetZoom-btn', gid: 'resetZoom' }, |
| 59 | |
Simon Hunt | 8d22c4b | 2015-08-06 16:24:43 -0700 | [diff] [blame] | 60 | E: { id: 'eqMaster-btn', gid: 'eqMaster' } |
Simon Hunt | 0906014 | 2015-03-18 20:23:32 -0700 | [diff] [blame] | 61 | }; |
Bri Prebilic Cole | 4db8dce | 2015-03-18 13:57:24 -0700 | [diff] [blame] | 62 | |
Simon Hunt | 8d22c4b | 2015-08-06 16:24:43 -0700 | [diff] [blame] | 63 | var prohibited = [ |
| 64 | 'T', 'backSlash', 'slash', |
| 65 | 'X' // needed until we re-instate X above. |
| 66 | ]; |
| 67 | prohibited = prohibited.concat(d3.map(k2b).keys()); |
| 68 | |
| 69 | |
Simon Hunt | c7ae795 | 2015-04-08 18:59:27 -0700 | [diff] [blame] | 70 | // initial toggle state: default settings and tag to key mapping |
| 71 | var defaultPrefsState = { |
Simon Hunt | c7ae795 | 2015-04-08 18:59:27 -0700 | [diff] [blame] | 72 | summary: 1, |
Simon Hunt | fcbde89 | 2015-04-16 12:05:28 -0700 | [diff] [blame] | 73 | insts: 1, |
Simon Hunt | c7ae795 | 2015-04-08 18:59:27 -0700 | [diff] [blame] | 74 | detail: 1, |
Simon Hunt | fcbde89 | 2015-04-16 12:05:28 -0700 | [diff] [blame] | 75 | hosts: 0, |
| 76 | offdev: 1, |
| 77 | porthl: 1, |
Simon Hunt | d0fe66c | 2015-06-10 10:16:36 -0700 | [diff] [blame] | 78 | bg: 0, |
Simon Hunt | fcbde89 | 2015-04-16 12:05:28 -0700 | [diff] [blame] | 79 | spr: 0, |
Simon Hunt | d0fe66c | 2015-06-10 10:16:36 -0700 | [diff] [blame] | 80 | toolbar: 0 |
Simon Hunt | c7ae795 | 2015-04-08 18:59:27 -0700 | [diff] [blame] | 81 | }, |
| 82 | prefsMap = { |
Simon Hunt | c7ae795 | 2015-04-08 18:59:27 -0700 | [diff] [blame] | 83 | summary: 'O', |
Simon Hunt | fcbde89 | 2015-04-16 12:05:28 -0700 | [diff] [blame] | 84 | insts: 'I', |
| 85 | detail: 'D', |
| 86 | hosts: 'H', |
| 87 | offdev: 'M', |
| 88 | porthl: 'P', |
| 89 | bg: 'B', |
| 90 | spr: 'S' |
| 91 | // NOTE: toolbar state is handled separately |
Simon Hunt | c7ae795 | 2015-04-08 18:59:27 -0700 | [diff] [blame] | 92 | }; |
| 93 | |
Bri Prebilic Cole | 4db8dce | 2015-03-18 13:57:24 -0700 | [diff] [blame] | 94 | function init(_api_) { |
| 95 | api = _api_; |
Simon Hunt | c7ae795 | 2015-04-08 18:59:27 -0700 | [diff] [blame] | 96 | |
| 97 | // retrieve initial toggle button settings from user prefs |
| 98 | setInitToggleState(); |
| 99 | } |
| 100 | |
| 101 | function topoDefPrefs() { |
| 102 | return angular.extend({}, defaultPrefsState); |
| 103 | } |
| 104 | |
| 105 | function setInitToggleState() { |
Simon Hunt | fcbde89 | 2015-04-16 12:05:28 -0700 | [diff] [blame] | 106 | cachedState = ps.asNumbers(ps.getPrefs(cooktag)); |
| 107 | $log.debug('TOOLBAR---- read prefs state:', cachedState); |
Simon Hunt | c7ae795 | 2015-04-08 18:59:27 -0700 | [diff] [blame] | 108 | |
Simon Hunt | fcbde89 | 2015-04-16 12:05:28 -0700 | [diff] [blame] | 109 | if (!cachedState) { |
| 110 | cachedState = topoDefPrefs(); |
| 111 | ps.setPrefs(cooktag, cachedState); |
| 112 | $log.debug('TOOLBAR---- Set default prefs state:', cachedState); |
Simon Hunt | c7ae795 | 2015-04-08 18:59:27 -0700 | [diff] [blame] | 113 | } |
| 114 | |
| 115 | angular.forEach(prefsMap, function (v, k) { |
Simon Hunt | fcbde89 | 2015-04-16 12:05:28 -0700 | [diff] [blame] | 116 | var cfg = k2b[v]; |
| 117 | cfg && (cfg.isel = !!cachedState[k]); |
Simon Hunt | c7ae795 | 2015-04-08 18:59:27 -0700 | [diff] [blame] | 118 | }); |
Bri Prebilic Cole | 4db8dce | 2015-03-18 13:57:24 -0700 | [diff] [blame] | 119 | } |
| 120 | |
Simon Hunt | 0906014 | 2015-03-18 20:23:32 -0700 | [diff] [blame] | 121 | function initKeyData() { |
Simon Hunt | 8d22c4b | 2015-08-06 16:24:43 -0700 | [diff] [blame] | 122 | // TODO: use angular forEach instead of d3.map |
Simon Hunt | 0906014 | 2015-03-18 20:23:32 -0700 | [diff] [blame] | 123 | keyData = d3.map(k2b); |
| 124 | keyData.forEach(function(key, value) { |
| 125 | var data = api.getActionEntry(key); |
Simon Hunt | 90dcc3e | 2015-03-25 15:01:27 -0700 | [diff] [blame] | 126 | value.cb = data[0]; // on-click callback |
| 127 | value.tt = data[1] + ' (' + key + ')'; // tooltip |
Simon Hunt | 0906014 | 2015-03-18 20:23:32 -0700 | [diff] [blame] | 128 | }); |
Bri Prebilic Cole | 4db8dce | 2015-03-18 13:57:24 -0700 | [diff] [blame] | 129 | } |
| 130 | |
Bri Prebilic Cole | 812f6c0 | 2015-03-24 17:10:33 -0700 | [diff] [blame] | 131 | function addButton(key) { |
| 132 | var v = keyData.get(key); |
| 133 | v.btn = toolbar.addButton(v.id, v.gid, v.cb, v.tt); |
| 134 | } |
Simon Hunt | 8d22c4b | 2015-08-06 16:24:43 -0700 | [diff] [blame] | 135 | |
Bri Prebilic Cole | d874546 | 2015-06-01 16:08:57 -0700 | [diff] [blame] | 136 | function addToggle(key, suppressIfMobile) { |
Simon Hunt | 0906014 | 2015-03-18 20:23:32 -0700 | [diff] [blame] | 137 | var v = keyData.get(key); |
Bri Prebilic Cole | d874546 | 2015-06-01 16:08:57 -0700 | [diff] [blame] | 138 | if (suppressIfMobile && fs.isMobile()) { return; } |
Simon Hunt | 0906014 | 2015-03-18 20:23:32 -0700 | [diff] [blame] | 139 | v.tog = toolbar.addToggle(v.id, v.gid, v.isel, v.cb, v.tt); |
Bri Prebilic Cole | 4db8dce | 2015-03-18 13:57:24 -0700 | [diff] [blame] | 140 | } |
| 141 | |
Bri Prebilic Cole | 04b4140 | 2015-03-18 17:25:34 -0700 | [diff] [blame] | 142 | function addFirstRow() { |
Simon Hunt | 0906014 | 2015-03-18 20:23:32 -0700 | [diff] [blame] | 143 | addToggle('I'); |
Simon Hunt | da2f3cc | 2015-03-19 15:11:57 -0700 | [diff] [blame] | 144 | addToggle('O'); |
Simon Hunt | 0906014 | 2015-03-18 20:23:32 -0700 | [diff] [blame] | 145 | addToggle('D'); |
Bri Prebilic Cole | 4db8dce | 2015-03-18 13:57:24 -0700 | [diff] [blame] | 146 | toolbar.addSeparator(); |
| 147 | |
Simon Hunt | 0906014 | 2015-03-18 20:23:32 -0700 | [diff] [blame] | 148 | addToggle('H'); |
| 149 | addToggle('M'); |
Bri Prebilic Cole | d874546 | 2015-06-01 16:08:57 -0700 | [diff] [blame] | 150 | addToggle('P', true); |
Simon Hunt | 0906014 | 2015-03-18 20:23:32 -0700 | [diff] [blame] | 151 | addToggle('B'); |
Bri Prebilic Cole | d874546 | 2015-06-01 16:08:57 -0700 | [diff] [blame] | 152 | addToggle('S', true); |
Bri Prebilic Cole | 04b4140 | 2015-03-18 17:25:34 -0700 | [diff] [blame] | 153 | } |
Simon Hunt | 72e44bf | 2015-07-21 21:34:20 -0700 | [diff] [blame] | 154 | |
Bri Prebilic Cole | 812f6c0 | 2015-03-24 17:10:33 -0700 | [diff] [blame] | 155 | function addSecondRow() { |
Bri Prebilic Cole | 7c98051 | 2015-03-25 12:31:29 -0700 | [diff] [blame] | 156 | //addToggle('X'); |
Bri Prebilic Cole | 812f6c0 | 2015-03-24 17:10:33 -0700 | [diff] [blame] | 157 | addToggle('Z'); |
Bri Prebilic Cole | b5f2b15 | 2015-04-07 14:58:09 -0700 | [diff] [blame] | 158 | addButton('N'); |
Bri Prebilic Cole | 812f6c0 | 2015-03-24 17:10:33 -0700 | [diff] [blame] | 159 | addButton('L'); |
| 160 | addButton('R'); |
Simon Hunt | 72e44bf | 2015-07-21 21:34:20 -0700 | [diff] [blame] | 161 | toolbar.addSeparator(); |
| 162 | addButton('E'); |
Bri Prebilic Cole | 812f6c0 | 2015-03-24 17:10:33 -0700 | [diff] [blame] | 163 | } |
Simon Hunt | 72e44bf | 2015-07-21 21:34:20 -0700 | [diff] [blame] | 164 | |
Simon Hunt | 72e44bf | 2015-07-21 21:34:20 -0700 | [diff] [blame] | 165 | function addOverlays() { |
| 166 | toolbar.addSeparator(); |
| 167 | |
| 168 | // generate radio button set for overlays; start with 'none' |
| 169 | var rset = [{ |
Andrea Campanella | 0c17a0a | 2015-12-01 09:53:51 -0800 | [diff] [blame] | 170 | gid: 'unknown', |
Simon Hunt | 72e44bf | 2015-07-21 21:34:20 -0700 | [diff] [blame] | 171 | tooltip: 'No Overlay', |
Simon Hunt | e05cae4 | 2015-07-23 17:35:24 -0700 | [diff] [blame] | 172 | cb: function () { |
Simon Hunt | 8d22c4b | 2015-08-06 16:24:43 -0700 | [diff] [blame] | 173 | tov.tbSelection(null, switchOverlayActions); |
Simon Hunt | e05cae4 | 2015-07-23 17:35:24 -0700 | [diff] [blame] | 174 | } |
Simon Hunt | 72e44bf | 2015-07-21 21:34:20 -0700 | [diff] [blame] | 175 | }]; |
Simon Hunt | a5b53af | 2015-10-12 15:56:40 -0700 | [diff] [blame] | 176 | ovIndex = tov.augmentRbset(rset, switchOverlayActions); |
| 177 | ovRset = toolbar.addRadioSet('topo-overlays', rset); |
Simon Hunt | 72e44bf | 2015-07-21 21:34:20 -0700 | [diff] [blame] | 178 | } |
| 179 | |
Simon Hunt | 8d22c4b | 2015-08-06 16:24:43 -0700 | [diff] [blame] | 180 | // invoked by overlay service to switch out old buttons and switch in new |
| 181 | function switchOverlayActions(oid, keyBindings) { |
| 182 | var prohibits = [], |
| 183 | kb = fs.isO(keyBindings) || {}, |
| 184 | order = fs.isA(kb._keyOrder) || []; |
| 185 | |
| 186 | if (keyBindings && !keyBindings._keyOrder) { |
| 187 | $log.warn(soa + 'no _keyOrder property defined'); |
| 188 | } else { |
| 189 | // sanity removal of reserved property names |
| 190 | ['esc', '_keyListener', '_helpFormat'].forEach(function (k) { |
| 191 | fs.removeFromArray(k, order); |
| 192 | }); |
| 193 | } |
| 194 | |
Simon Hunt | a211f7f | 2015-11-09 12:48:23 -0800 | [diff] [blame] | 195 | // ensure dialog has closed (if opened by outgoing overlay) |
| 196 | tds.closeDialog(); |
Simon Hunt | 8d22c4b | 2015-08-06 16:24:43 -0700 | [diff] [blame] | 197 | thirdRow.clear(); |
| 198 | |
| 199 | if (!order.length) { |
| 200 | thirdRow.setText(selOver); |
| 201 | thirdRow.classed('right', true); |
| 202 | api.setUpKeys(); // clear previous overlay key bindings |
| 203 | |
| 204 | } else { |
| 205 | thirdRow.classed('right', false); |
| 206 | angular.forEach(order, function (key) { |
| 207 | var value, bid, gid, tt; |
| 208 | |
| 209 | if (prohibited.indexOf(key) > -1) { |
| 210 | prohibits.push(key); |
| 211 | |
| 212 | } else { |
| 213 | value = keyBindings[key]; |
| 214 | bid = oid + '-' + key; |
| 215 | gid = tov.mkGlyphId(oid, value.gid); |
| 216 | tt = value.tt + ' (' + key + ')'; |
| 217 | thirdRow.addButton(bid, gid, value.cb, tt); |
| 218 | } |
| 219 | }); |
| 220 | api.setUpKeys(keyBindings); // add overlay key bindings |
| 221 | } |
| 222 | |
| 223 | if (prohibits.length) { |
| 224 | $log.warn(soa + 'Prohibited key bindings ignored:', prohibits); |
| 225 | } |
Bri Prebilic Cole | 812f6c0 | 2015-03-24 17:10:33 -0700 | [diff] [blame] | 226 | } |
Bri Prebilic Cole | 4db8dce | 2015-03-18 13:57:24 -0700 | [diff] [blame] | 227 | |
Bri Prebilic Cole | 04b4140 | 2015-03-18 17:25:34 -0700 | [diff] [blame] | 228 | function createToolbar() { |
Simon Hunt | 0906014 | 2015-03-18 20:23:32 -0700 | [diff] [blame] | 229 | initKeyData(); |
Bri Prebilic Cole | d621905 | 2015-03-19 14:34:02 -0700 | [diff] [blame] | 230 | toolbar = tbs.createToolbar(name); |
Bri Prebilic Cole | 04b4140 | 2015-03-18 17:25:34 -0700 | [diff] [blame] | 231 | addFirstRow(); |
Bri Prebilic Cole | 812f6c0 | 2015-03-24 17:10:33 -0700 | [diff] [blame] | 232 | toolbar.addRow(); |
| 233 | addSecondRow(); |
Simon Hunt | 72e44bf | 2015-07-21 21:34:20 -0700 | [diff] [blame] | 234 | addOverlays(); |
Simon Hunt | 8d22c4b | 2015-08-06 16:24:43 -0700 | [diff] [blame] | 235 | thirdRow = toolbar.addRow(); |
| 236 | thirdRow.setText(selOver); |
| 237 | thirdRow.classed('right', true); |
Simon Hunt | 72e44bf | 2015-07-21 21:34:20 -0700 | [diff] [blame] | 238 | |
Simon Hunt | fcbde89 | 2015-04-16 12:05:28 -0700 | [diff] [blame] | 239 | if (cachedState.toolbar) { |
| 240 | toolbar.show(); |
| 241 | } else { |
| 242 | toolbar.hide(); |
| 243 | } |
Bri Prebilic Cole | 4db8dce | 2015-03-18 13:57:24 -0700 | [diff] [blame] | 244 | } |
| 245 | |
Bri Prebilic Cole | d621905 | 2015-03-19 14:34:02 -0700 | [diff] [blame] | 246 | function destroyToolbar() { |
| 247 | tbs.destroyToolbar(name); |
Simon Hunt | 4a6b54b | 2015-10-27 22:08:25 -0700 | [diff] [blame] | 248 | tov.resetOnToolbarDestroy(); |
Bri Prebilic Cole | d621905 | 2015-03-19 14:34:02 -0700 | [diff] [blame] | 249 | } |
| 250 | |
Simon Hunt | 0906014 | 2015-03-18 20:23:32 -0700 | [diff] [blame] | 251 | // allows us to ensure the button states track key strokes |
| 252 | function keyListener(key) { |
| 253 | var v = keyData.get(key); |
| 254 | |
| 255 | if (v) { |
| 256 | // we have a valid button mapping |
| 257 | if (v.tog) { |
| 258 | // it's a toggle button |
| 259 | v.tog.toggleNoCb(); |
| 260 | } |
| 261 | } |
| 262 | } |
| 263 | |
Simon Hunt | 90dcc3e | 2015-03-25 15:01:27 -0700 | [diff] [blame] | 264 | function toggleToolbar() { |
| 265 | toolbar.toggle(); |
| 266 | } |
| 267 | |
Simon Hunt | a5b53af | 2015-10-12 15:56:40 -0700 | [diff] [blame] | 268 | function setDefaultOverlay() { |
| 269 | var idx = ovIndex[defaultOverlay] || 0; |
| 270 | ovRset.selectedIndex(idx); |
| 271 | } |
| 272 | |
Bri Prebilic Cole | 4db8dce | 2015-03-18 13:57:24 -0700 | [diff] [blame] | 273 | angular.module('ovTopo') |
Simon Hunt | c7ae795 | 2015-04-08 18:59:27 -0700 | [diff] [blame] | 274 | .factory('TopoToolbarService', |
Bri Prebilic Cole | d874546 | 2015-06-01 16:08:57 -0700 | [diff] [blame] | 275 | ['$log', 'FnService', 'ToolbarService', 'PrefsService', |
Simon Hunt | a211f7f | 2015-11-09 12:48:23 -0800 | [diff] [blame] | 276 | 'TopoOverlayService', 'TopoDialogService', |
Bri Prebilic Cole | 4db8dce | 2015-03-18 13:57:24 -0700 | [diff] [blame] | 277 | |
Simon Hunt | a211f7f | 2015-11-09 12:48:23 -0800 | [diff] [blame] | 278 | function (_$log_, _fs_, _tbs_, _ps_, _tov_, _tds_) { |
Bri Prebilic Cole | 4db8dce | 2015-03-18 13:57:24 -0700 | [diff] [blame] | 279 | $log = _$log_; |
Bri Prebilic Cole | d874546 | 2015-06-01 16:08:57 -0700 | [diff] [blame] | 280 | fs = _fs_; |
Bri Prebilic Cole | 4db8dce | 2015-03-18 13:57:24 -0700 | [diff] [blame] | 281 | tbs = _tbs_; |
Simon Hunt | c7ae795 | 2015-04-08 18:59:27 -0700 | [diff] [blame] | 282 | ps = _ps_; |
Simon Hunt | 72e44bf | 2015-07-21 21:34:20 -0700 | [diff] [blame] | 283 | tov = _tov_; |
Simon Hunt | a211f7f | 2015-11-09 12:48:23 -0800 | [diff] [blame] | 284 | tds = _tds_; |
Bri Prebilic Cole | 4db8dce | 2015-03-18 13:57:24 -0700 | [diff] [blame] | 285 | |
| 286 | return { |
| 287 | init: init, |
Simon Hunt | 0906014 | 2015-03-18 20:23:32 -0700 | [diff] [blame] | 288 | createToolbar: createToolbar, |
Bri Prebilic Cole | d621905 | 2015-03-19 14:34:02 -0700 | [diff] [blame] | 289 | destroyToolbar: destroyToolbar, |
Simon Hunt | 90dcc3e | 2015-03-25 15:01:27 -0700 | [diff] [blame] | 290 | keyListener: keyListener, |
Simon Hunt | a5b53af | 2015-10-12 15:56:40 -0700 | [diff] [blame] | 291 | toggleToolbar: toggleToolbar, |
| 292 | setDefaultOverlay: setDefaultOverlay |
Bri Prebilic Cole | 4db8dce | 2015-03-18 13:57:24 -0700 | [diff] [blame] | 293 | }; |
| 294 | }]); |
| 295 | }()); |