Paul Greyson | bcd3c77 | 2013-03-21 13:16:44 -0700 | [diff] [blame] | 1 | function parseURLParameters() { |
| 2 | var parameters = {}; |
| 3 | |
| 4 | var search = location.href.split('?')[1]; |
| 5 | if (search) { |
| 6 | search.split('&').forEach(function (param) { |
| 7 | var key = param.split('=')[0]; |
| 8 | var value = param.split('=')[1]; |
| 9 | parameters[key] = decodeURIComponent(value); |
| 10 | }); |
| 11 | } |
| 12 | |
| 13 | return parameters; |
Paul Greyson | 5cc35f0 | 2013-03-28 10:07:36 -0700 | [diff] [blame] | 14 | } |
| 15 | |
| 16 | function findLink(model, dpid) { |
| 17 | var links = []; |
| 18 | model.links.forEach(function (link) { |
| 19 | if (link['src-switch'] == dpid || link['dst-switch'] == dpid) { |
| 20 | links.push(link); |
| 21 | } |
| 22 | }); |
| 23 | return links; |
Paul Greyson | bcd3c77 | 2013-03-21 13:16:44 -0700 | [diff] [blame] | 24 | } |