Steven Burrows | 57e24e9 | 2016-08-04 18:38:24 +0100 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2016-present 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 Links Module. |
| 19 | Module that holds the links for a region |
| 20 | */ |
| 21 | |
| 22 | (function () { |
| 23 | 'use strict'; |
| 24 | |
Steven Burrows | 86af435 | 2016-11-16 18:19:12 -0600 | [diff] [blame^] | 25 | var $log, Collection, Model, ts, sus, t2zs, t2vs, t2lps, fn; |
Steven Burrows | 9edc7e0 | 2016-08-29 11:52:07 +0100 | [diff] [blame] | 26 | |
| 27 | var linkLabelOffset = '0.35em'; |
Steven Burrows | 57e24e9 | 2016-08-04 18:38:24 +0100 | [diff] [blame] | 28 | |
Steven Burrows | ec1f45c | 2016-08-08 16:14:41 +0100 | [diff] [blame] | 29 | var widthRatio = 1.4, |
| 30 | linkScale = d3.scale.linear() |
| 31 | .domain([1, 12]) |
| 32 | .range([widthRatio, 12 * widthRatio]) |
| 33 | .clamp(true), |
Steven Burrows | 583f4be | 2016-11-04 14:06:50 +0100 | [diff] [blame] | 34 | allLinkTypes = 'direct optical tunnel UiDeviceLink', |
| 35 | allLinkSubTypes = 'not-permitted', |
Steven Burrows | a3fca81 | 2016-10-14 15:11:04 -0500 | [diff] [blame] | 36 | labelDim = 30; |
Steven Burrows | ec1f45c | 2016-08-08 16:14:41 +0100 | [diff] [blame] | 37 | |
| 38 | // configuration |
| 39 | var linkConfig = { |
| 40 | light: { |
| 41 | baseColor: '#939598', |
| 42 | inColor: '#66f', |
| 43 | outColor: '#f00' |
| 44 | }, |
| 45 | dark: { |
| 46 | // TODO : theme |
| 47 | baseColor: '#939598', |
| 48 | inColor: '#66f', |
| 49 | outColor: '#f00' |
| 50 | }, |
| 51 | inWidth: 12, |
| 52 | outWidth: 10 |
| 53 | }; |
| 54 | |
Steven Burrows | ec1f45c | 2016-08-08 16:14:41 +0100 | [diff] [blame] | 55 | function createLink() { |
| 56 | |
| 57 | var linkPoints = this.linkEndPoints(this.get('epA'), this.get('epB')); |
Steven Burrows | ec1f45c | 2016-08-08 16:14:41 +0100 | [diff] [blame] | 58 | |
| 59 | var attrs = angular.extend({}, linkPoints, { |
| 60 | key: this.get('id'), |
| 61 | class: 'link', |
Steven Burrows | ec1f45c | 2016-08-08 16:14:41 +0100 | [diff] [blame] | 62 | srcPort: this.get('srcPort'), |
| 63 | tgtPort: this.get('dstPort'), |
| 64 | position: { |
| 65 | x1: 0, |
| 66 | y1: 0, |
| 67 | x2: 0, |
| 68 | y2: 0 |
| 69 | } |
| 70 | // functions to aggregate dual link state |
Steven Burrows | 9edc7e0 | 2016-08-29 11:52:07 +0100 | [diff] [blame] | 71 | // extra: link.extra |
Steven Burrows | ec1f45c | 2016-08-08 16:14:41 +0100 | [diff] [blame] | 72 | }); |
| 73 | |
| 74 | this.set(attrs); |
| 75 | } |
| 76 | |
Steven Burrows | 9edc7e0 | 2016-08-29 11:52:07 +0100 | [diff] [blame] | 77 | function rectAroundText(el) { |
| 78 | var text = el.select('text'), |
| 79 | box = text.node().getBBox(); |
| 80 | |
| 81 | // translate the bbox so that it is centered on [x,y] |
| 82 | box.x = -box.width / 2; |
| 83 | box.y = -box.height / 2; |
| 84 | |
| 85 | // add padding |
| 86 | box.x -= 4; |
| 87 | box.width += 8; |
| 88 | return box; |
| 89 | } |
| 90 | |
Steven Burrows | dfa52b0 | 2016-09-02 13:50:43 +0100 | [diff] [blame] | 91 | function isLinkOnline(node) { |
| 92 | return (node.get('nodeType') === 'region') ? true : node.get('online'); |
| 93 | } |
| 94 | |
Steven Burrows | ec1f45c | 2016-08-08 16:14:41 +0100 | [diff] [blame] | 95 | function linkEndPoints(srcId, dstId) { |
| 96 | |
Steven Burrows | a3fca81 | 2016-10-14 15:11:04 -0500 | [diff] [blame] | 97 | var allNodes = this.region.nodes(); |
Steven Burrows | 8f45ce2 | 2016-10-27 20:04:14 -0500 | [diff] [blame] | 98 | var sourceNode = this.region.findNodeById(this, srcId); |
| 99 | var targetNode = this.region.findNodeById(this, dstId); |
Steven Burrows | ec1f45c | 2016-08-08 16:14:41 +0100 | [diff] [blame] | 100 | |
Steven Burrows | 6deb4ce | 2016-08-26 16:06:23 +0100 | [diff] [blame] | 101 | if (!sourceNode || !targetNode) { |
Steven Burrows | 8f45ce2 | 2016-10-27 20:04:14 -0500 | [diff] [blame] | 102 | $log.error('Node(s) not on map for link:' + srcId + '~' + dstId); |
Steven Burrows | dfa52b0 | 2016-09-02 13:50:43 +0100 | [diff] [blame] | 103 | // logicError('Node(s) not on map for link:\n' + sMiss + dMiss); |
Steven Burrows | 6deb4ce | 2016-08-26 16:06:23 +0100 | [diff] [blame] | 104 | return null; |
| 105 | } |
Steven Burrows | ec1f45c | 2016-08-08 16:14:41 +0100 | [diff] [blame] | 106 | |
Steven Burrows | a3fca81 | 2016-10-14 15:11:04 -0500 | [diff] [blame] | 107 | this.source = allNodes.indexOf(sourceNode); |
| 108 | this.target = allNodes.indexOf(targetNode); |
| 109 | this.sourceNode = sourceNode; |
| 110 | this.targetNode = targetNode; |
Steven Burrows | ec1f45c | 2016-08-08 16:14:41 +0100 | [diff] [blame] | 111 | |
| 112 | return { |
| 113 | source: sourceNode, |
| 114 | target: targetNode |
| 115 | }; |
| 116 | } |
| 117 | |
| 118 | function createLinkCollection(data, _region) { |
| 119 | |
| 120 | var LinkModel = Model.extend({ |
| 121 | region: _region, |
| 122 | createLink: createLink, |
| 123 | linkEndPoints: linkEndPoints, |
| 124 | type: function () { |
| 125 | return this.get('type'); |
| 126 | }, |
Steven Burrows | 86af435 | 2016-11-16 18:19:12 -0600 | [diff] [blame^] | 127 | svgClassName: function () { |
| 128 | return fn.classNames('link', |
| 129 | this.nodeType, |
| 130 | this.get('type'), |
| 131 | { |
| 132 | enhanced: this.get('enhanced'), |
| 133 | selected: this.get('selected') |
| 134 | } |
| 135 | ); |
| 136 | }, |
Steven Burrows | ec1f45c | 2016-08-08 16:14:41 +0100 | [diff] [blame] | 137 | expected: function () { |
Steven Burrows | 9edc7e0 | 2016-08-29 11:52:07 +0100 | [diff] [blame] | 138 | // TODO: original code is: (s && s.expected) && (t && t.expected); |
Steven Burrows | ec1f45c | 2016-08-08 16:14:41 +0100 | [diff] [blame] | 139 | return true; |
| 140 | }, |
| 141 | online: function () { |
Steven Burrows | 9edc7e0 | 2016-08-29 11:52:07 +0100 | [diff] [blame] | 142 | |
Steven Burrows | dfa52b0 | 2016-09-02 13:50:43 +0100 | [diff] [blame] | 143 | var source = this.get('source'), |
| 144 | target = this.get('target'), |
| 145 | sourceOnline = isLinkOnline(source), |
| 146 | targetOnline = isLinkOnline(target); |
| 147 | |
| 148 | return (sourceOnline) && (targetOnline); |
Steven Burrows | ec1f45c | 2016-08-08 16:14:41 +0100 | [diff] [blame] | 149 | }, |
Steven Burrows | 86af435 | 2016-11-16 18:19:12 -0600 | [diff] [blame^] | 150 | onChange: function () { |
| 151 | // Update class names when the model changes |
| 152 | if (this.el) { |
| 153 | this.el.attr('class', this.svgClassName()); |
| 154 | } |
| 155 | }, |
Steven Burrows | 9edc7e0 | 2016-08-29 11:52:07 +0100 | [diff] [blame] | 156 | enhance: function () { |
| 157 | var data = [], |
| 158 | point; |
| 159 | |
| 160 | angular.forEach(this.collection.models, function (link) { |
| 161 | link.unenhance(); |
| 162 | }); |
| 163 | |
Steven Burrows | 86af435 | 2016-11-16 18:19:12 -0600 | [diff] [blame^] | 164 | this.set('enhanced', true); |
Steven Burrows | 9edc7e0 | 2016-08-29 11:52:07 +0100 | [diff] [blame] | 165 | |
Steven Burrows | 1c5c861 | 2016-10-05 13:45:13 -0500 | [diff] [blame] | 166 | if (showPort()) { |
| 167 | point = this.locatePortLabel(); |
Steven Burrows | dfa52b0 | 2016-09-02 13:50:43 +0100 | [diff] [blame] | 168 | angular.extend(point, { |
Steven Burrows | 1c5c861 | 2016-10-05 13:45:13 -0500 | [diff] [blame] | 169 | id: 'topo-port-tgt', |
| 170 | num: this.get('portB') |
Steven Burrows | dfa52b0 | 2016-09-02 13:50:43 +0100 | [diff] [blame] | 171 | }); |
| 172 | data.push(point); |
Steven Burrows | 1c5c861 | 2016-10-05 13:45:13 -0500 | [diff] [blame] | 173 | |
| 174 | if (this.get('portA')) { |
| 175 | point = this.locatePortLabel(1); |
| 176 | angular.extend(point, { |
| 177 | id: 'topo-port-src', |
| 178 | num: this.get('portA') |
| 179 | }); |
| 180 | data.push(point); |
| 181 | } |
| 182 | |
| 183 | var entering = d3.select('#topo-portLabels') |
| 184 | .selectAll('.portLabel') |
Steven Burrows | a3fca81 | 2016-10-14 15:11:04 -0500 | [diff] [blame] | 185 | .data(data) |
| 186 | .enter().append('g') |
Steven Burrows | 1c5c861 | 2016-10-05 13:45:13 -0500 | [diff] [blame] | 187 | .classed('portLabel', true) |
Steven Burrows | a3fca81 | 2016-10-14 15:11:04 -0500 | [diff] [blame] | 188 | .attr('id', function (d) { return d.id; }) |
Steven Burrows | 1c5c861 | 2016-10-05 13:45:13 -0500 | [diff] [blame] | 189 | |
| 190 | entering.each(function (d) { |
| 191 | var el = d3.select(this), |
| 192 | rect = el.append('rect'), |
| 193 | text = el.append('text').text(d.num); |
| 194 | |
| 195 | var rectSize = rectAroundText(el); |
| 196 | |
| 197 | rect.attr(rectSize) |
| 198 | .attr('rx', 2) |
| 199 | .attr('ry', 2); |
| 200 | |
| 201 | text.attr('dy', linkLabelOffset) |
| 202 | .attr('text-anchor', 'middle'); |
| 203 | |
| 204 | el.attr('transform', sus.translate(d.x, d.y)); |
Steven Burrows | a3fca81 | 2016-10-14 15:11:04 -0500 | [diff] [blame] | 205 | |
Steven Burrows | 1c5c861 | 2016-10-05 13:45:13 -0500 | [diff] [blame] | 206 | }); |
Steven Burrows | a3fca81 | 2016-10-14 15:11:04 -0500 | [diff] [blame] | 207 | |
| 208 | this.setScale(); |
Steven Burrows | dfa52b0 | 2016-09-02 13:50:43 +0100 | [diff] [blame] | 209 | } |
Steven Burrows | 9edc7e0 | 2016-08-29 11:52:07 +0100 | [diff] [blame] | 210 | }, |
| 211 | unenhance: function () { |
Steven Burrows | 86af435 | 2016-11-16 18:19:12 -0600 | [diff] [blame^] | 212 | this.set('enhanced', false); |
Steven Burrows | 9edc7e0 | 2016-08-29 11:52:07 +0100 | [diff] [blame] | 213 | d3.select('#topo-portLabels').selectAll('.portLabel').remove(); |
| 214 | }, |
Steven Burrows | 86af435 | 2016-11-16 18:19:12 -0600 | [diff] [blame^] | 215 | select: function () { |
| 216 | var ev = d3.event; |
| 217 | |
| 218 | // TODO: if single selection clear selected devices, hosts, sub-regions |
| 219 | var s = Boolean(this.get('selected')); |
| 220 | // Clear all selected Items |
| 221 | _.each(this.collection.models, function (m) { |
| 222 | m.set('selected', false); |
| 223 | }); |
| 224 | |
| 225 | this.set('selected', !s); |
| 226 | |
| 227 | var selected = this.collection.filter(function (m) { |
| 228 | return m.get('selected'); |
| 229 | }); |
| 230 | |
| 231 | return selected; |
| 232 | }, |
| 233 | showDetails: function () { |
| 234 | var selected = this.select(d3.event); |
| 235 | |
| 236 | if (selected) { |
| 237 | t2lps.displayLink(this); |
| 238 | } else { |
| 239 | t2lps.hide(); |
| 240 | } |
| 241 | }, |
Steven Burrows | dfa52b0 | 2016-09-02 13:50:43 +0100 | [diff] [blame] | 242 | locatePortLabel: function (src) { |
Steven Burrows | a3fca81 | 2016-10-14 15:11:04 -0500 | [diff] [blame] | 243 | |
| 244 | var offset = 32 / (labelDim * t2zs.scale()), |
| 245 | sourceX = this.get('position').x1, |
| 246 | sourceY = this.get('position').y1, |
| 247 | targetX = this.get('position').x2, |
| 248 | targetY = this.get('position').y2, |
| 249 | nearX = src ? sourceX : targetX, |
| 250 | nearY = src ? sourceY : targetY, |
| 251 | farX = src ? targetX : sourceX, |
| 252 | farY = src ? targetY : sourceY; |
Steven Burrows | 9edc7e0 | 2016-08-29 11:52:07 +0100 | [diff] [blame] | 253 | |
Steven Burrows | dfa52b0 | 2016-09-02 13:50:43 +0100 | [diff] [blame] | 254 | function dist(x, y) { |
| 255 | return Math.sqrt(x * x + y * y); |
| 256 | } |
Steven Burrows | 9edc7e0 | 2016-08-29 11:52:07 +0100 | [diff] [blame] | 257 | |
| 258 | var dx = farX - nearX, |
| 259 | dy = farY - nearY, |
Steven Burrows | a3fca81 | 2016-10-14 15:11:04 -0500 | [diff] [blame] | 260 | k = (32 * offset) / dist(dx, dy); |
Steven Burrows | 9edc7e0 | 2016-08-29 11:52:07 +0100 | [diff] [blame] | 261 | |
Steven Burrows | dfa52b0 | 2016-09-02 13:50:43 +0100 | [diff] [blame] | 262 | return { x: k * dx + nearX, y: k * dy + nearY }; |
Steven Burrows | 9edc7e0 | 2016-08-29 11:52:07 +0100 | [diff] [blame] | 263 | }, |
Steven Burrows | ec1f45c | 2016-08-08 16:14:41 +0100 | [diff] [blame] | 264 | restyleLinkElement: function (immediate) { |
| 265 | // this fn's job is to look at raw links and decide what svg classes |
| 266 | // need to be applied to the line element in the DOM |
| 267 | var th = ts.theme(), |
| 268 | el = this.el, |
| 269 | type = this.get('type'), |
Steven Burrows | ec1f45c | 2016-08-08 16:14:41 +0100 | [diff] [blame] | 270 | online = this.online(), |
Steven Burrows | 583f4be | 2016-11-04 14:06:50 +0100 | [diff] [blame] | 271 | modeCls = this.expected() ? '-inactive' : 'not-permitted', |
Steven Burrows | ec1f45c | 2016-08-08 16:14:41 +0100 | [diff] [blame] | 272 | delay = immediate ? 0 : 1000; |
| 273 | |
Steven Burrows | ec1f45c | 2016-08-08 16:14:41 +0100 | [diff] [blame] | 274 | // NOTE: understand why el is sometimes undefined on addLink events... |
| 275 | // Investigated: |
| 276 | // el is undefined when it's a reverse link that is being added. |
| 277 | // updateLinks (which sets ldata.el) isn't called before this is called. |
| 278 | // Calling _updateLinks in addLinkUpdate fixes it, but there might be |
| 279 | // a more efficient way to fix it. |
| 280 | if (el && !el.empty()) { |
| 281 | el.classed('link', true); |
| 282 | el.classed(allLinkSubTypes, false); |
| 283 | el.classed(modeCls, !online); |
| 284 | el.classed(allLinkTypes, false); |
| 285 | if (type) { |
| 286 | el.classed(type, true); |
| 287 | } |
| 288 | el.transition() |
| 289 | .duration(delay) |
Steven Burrows | ec1f45c | 2016-08-08 16:14:41 +0100 | [diff] [blame] | 290 | .attr('stroke', linkConfig[th].baseColor); |
Steven Burrows | a3fca81 | 2016-10-14 15:11:04 -0500 | [diff] [blame] | 291 | |
| 292 | this.setScale(); |
Steven Burrows | ec1f45c | 2016-08-08 16:14:41 +0100 | [diff] [blame] | 293 | } |
| 294 | }, |
Steven Burrows | ec1f45c | 2016-08-08 16:14:41 +0100 | [diff] [blame] | 295 | onEnter: function (el) { |
Steven Burrows | dfa52b0 | 2016-09-02 13:50:43 +0100 | [diff] [blame] | 296 | var link = d3.select(el); |
Steven Burrows | 9edc7e0 | 2016-08-29 11:52:07 +0100 | [diff] [blame] | 297 | |
Steven Burrows | ec1f45c | 2016-08-08 16:14:41 +0100 | [diff] [blame] | 298 | this.el = link; |
Steven Burrows | ec1f45c | 2016-08-08 16:14:41 +0100 | [diff] [blame] | 299 | this.restyleLinkElement(); |
| 300 | |
Steven Burrows | a3fca81 | 2016-10-14 15:11:04 -0500 | [diff] [blame] | 301 | // TODO: Needs improving - originally this was calculated |
| 302 | // from mouse position. |
| 303 | this.el.on('mouseover', this.enhance.bind(this)); |
| 304 | this.el.on('mouseout', this.unenhance.bind(this)); |
Steven Burrows | 86af435 | 2016-11-16 18:19:12 -0600 | [diff] [blame^] | 305 | this.el.on('click', this.showDetails.bind(this)); |
Steven Burrows | a3fca81 | 2016-10-14 15:11:04 -0500 | [diff] [blame] | 306 | |
Steven Burrows | ec1f45c | 2016-08-08 16:14:41 +0100 | [diff] [blame] | 307 | if (this.get('type') === 'hostLink') { |
Steven Burrows | dfa52b0 | 2016-09-02 13:50:43 +0100 | [diff] [blame] | 308 | // sus.visible(link, api.showHosts()); |
Steven Burrows | ec1f45c | 2016-08-08 16:14:41 +0100 | [diff] [blame] | 309 | } |
Steven Burrows | 0616e80 | 2016-10-06 21:45:07 -0500 | [diff] [blame] | 310 | }, |
| 311 | setScale: function () { |
Steven Burrows | a3fca81 | 2016-10-14 15:11:04 -0500 | [diff] [blame] | 312 | var width = linkScale(widthRatio) / t2zs.scale(); |
Steven Burrows | 0616e80 | 2016-10-06 21:45:07 -0500 | [diff] [blame] | 313 | this.el.style('stroke-width', width + 'px'); |
Steven Burrows | a3fca81 | 2016-10-14 15:11:04 -0500 | [diff] [blame] | 314 | |
| 315 | var labelScale = labelDim / (labelDim * t2zs.scale()); |
| 316 | |
| 317 | d3.select('#topo-portLabels') |
| 318 | .selectAll('.portLabel') |
| 319 | .selectAll('*') |
| 320 | .style('transform', 'scale(' + labelScale + ')'); |
| 321 | |
Steven Burrows | 1c5c861 | 2016-10-05 13:45:13 -0500 | [diff] [blame] | 322 | }, |
| 323 | update: function () { |
Steven Burrows | 86af435 | 2016-11-16 18:19:12 -0600 | [diff] [blame^] | 324 | if (this.get('enhanced')) { |
Steven Burrows | 1c5c861 | 2016-10-05 13:45:13 -0500 | [diff] [blame] | 325 | this.enhance(); |
| 326 | } |
Steven Burrows | ec1f45c | 2016-08-08 16:14:41 +0100 | [diff] [blame] | 327 | } |
| 328 | }); |
Steven Burrows | 57e24e9 | 2016-08-04 18:38:24 +0100 | [diff] [blame] | 329 | |
| 330 | var LinkCollection = Collection.extend({ |
Steven Burrows | dfa52b0 | 2016-09-02 13:50:43 +0100 | [diff] [blame] | 331 | model: LinkModel |
Steven Burrows | 57e24e9 | 2016-08-04 18:38:24 +0100 | [diff] [blame] | 332 | }); |
| 333 | |
| 334 | return new LinkCollection(data); |
| 335 | } |
| 336 | |
Steven Burrows | 1c5c861 | 2016-10-05 13:45:13 -0500 | [diff] [blame] | 337 | function showPort() { |
| 338 | return t2vs.getPortHighlighting(); |
| 339 | } |
| 340 | |
Steven Burrows | 57e24e9 | 2016-08-04 18:38:24 +0100 | [diff] [blame] | 341 | angular.module('ovTopo2') |
| 342 | .factory('Topo2LinkService', |
Steven Burrows | dfa52b0 | 2016-09-02 13:50:43 +0100 | [diff] [blame] | 343 | ['$log', 'Topo2Collection', 'Topo2Model', |
Steven Burrows | 0616e80 | 2016-10-06 21:45:07 -0500 | [diff] [blame] | 344 | 'ThemeService', 'SvgUtilService', 'Topo2ZoomService', |
Steven Burrows | 86af435 | 2016-11-16 18:19:12 -0600 | [diff] [blame^] | 345 | 'Topo2ViewService', 'Topo2LinkPanelService', 'FnService', |
Steven Burrows | 1c5c861 | 2016-10-05 13:45:13 -0500 | [diff] [blame] | 346 | function (_$log_, _Collection_, _Model_, _ts_, _sus_, |
Steven Burrows | 86af435 | 2016-11-16 18:19:12 -0600 | [diff] [blame^] | 347 | _t2zs_, _t2vs_, _t2lps_, _fn_) { |
Steven Burrows | 57e24e9 | 2016-08-04 18:38:24 +0100 | [diff] [blame] | 348 | |
Steven Burrows | 6deb4ce | 2016-08-26 16:06:23 +0100 | [diff] [blame] | 349 | $log = _$log_; |
Steven Burrows | ec1f45c | 2016-08-08 16:14:41 +0100 | [diff] [blame] | 350 | ts = _ts_; |
Steven Burrows | 9edc7e0 | 2016-08-29 11:52:07 +0100 | [diff] [blame] | 351 | sus = _sus_; |
Steven Burrows | 0616e80 | 2016-10-06 21:45:07 -0500 | [diff] [blame] | 352 | t2zs = _t2zs_; |
Steven Burrows | 1c5c861 | 2016-10-05 13:45:13 -0500 | [diff] [blame] | 353 | t2vs = _t2vs_; |
Steven Burrows | 57e24e9 | 2016-08-04 18:38:24 +0100 | [diff] [blame] | 354 | Collection = _Collection_; |
Steven Burrows | ec1f45c | 2016-08-08 16:14:41 +0100 | [diff] [blame] | 355 | Model = _Model_; |
Steven Burrows | 86af435 | 2016-11-16 18:19:12 -0600 | [diff] [blame^] | 356 | t2lps = _t2lps_; |
| 357 | fn = _fn_; |
Steven Burrows | 57e24e9 | 2016-08-04 18:38:24 +0100 | [diff] [blame] | 358 | |
| 359 | return { |
| 360 | createLinkCollection: createLinkCollection |
| 361 | }; |
| 362 | } |
| 363 | ]); |
| 364 | |
| 365 | })(); |