Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 part of app; | 5 part of app; |
| 6 | 6 |
| 7 abstract class LocationManager extends Observable { | 7 abstract class LocationManager extends Observable { |
| 8 final _initialPath = '/vm'; | 8 final _initialPath = '/vm'; |
| 9 ObservatoryApplication _app; | 9 ObservatoryApplication _app; |
| 10 | 10 |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 44 if (url.startsWith('#')) { | 44 if (url.startsWith('#')) { |
| 45 url = url.substring(1); | 45 url = url.substring(1); |
| 46 } | 46 } |
| 47 // Fall through handles '#/' | 47 // Fall through handles '#/' |
| 48 // Chop off leading '/'. | 48 // Chop off leading '/'. |
| 49 if (url.startsWith('/')) { | 49 if (url.startsWith('/')) { |
| 50 url = url.substring(1); | 50 url = url.substring(1); |
| 51 } | 51 } |
| 52 var args; | 52 var args; |
| 53 // Parse out arguments. | 53 // Parse out arguments. |
| 54 if (url.contains('#')) { | 54 if (url.contains('---')) { |
| 55 var chunks = url.split('#'); | 55 var chunks = url.split('---'); |
| 56 url = chunks[0]; | 56 url = chunks[0]; |
|
Cutch
2014/07/30 18:47:18
Does this support multiple arguments?
Could we wr
turnidge
2014/07/30 19:28:15
Yes, it supports multiple arguments. This is only
Cutch
2014/07/30 21:58:39
We don't have unit tests for frontend Observatory.
| |
| 57 if ((chunks.length > 1) && (chunks[1] != '')) { | 57 if ((chunks.length > 1) && (chunks[1] != '')) { |
| 58 args = chunks[1]; | 58 args = chunks[1]; |
| 59 } | 59 } |
| 60 } | 60 } |
| 61 _app._visit(url, args); | 61 _app._visit(url, args); |
| 62 } | 62 } |
| 63 | 63 |
| 64 /// Go back. | 64 /// Go back. |
| 65 void back() { | 65 void back() { |
| 66 window.history.go(-1); | 66 window.history.go(-1); |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 124 _go(window.location.pathname); | 124 _go(window.location.pathname); |
| 125 } | 125 } |
| 126 | 126 |
| 127 void _onLocationChange(PopStateEvent _) { | 127 void _onLocationChange(PopStateEvent _) { |
| 128 _go(window.location.pathname); | 128 _go(window.location.pathname); |
| 129 } | 129 } |
| 130 | 130 |
| 131 /// Given an application url, generate a link for an anchor tag. | 131 /// Given an application url, generate a link for an anchor tag. |
| 132 String makeLink(String url) => url; | 132 String makeLink(String url) => url; |
| 133 } | 133 } |
| OLD | NEW |