| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 /** Provides client-side behavior for generated docs. */ | 5 /** Provides client-side behavior for generated docs. */ |
| 6 library client; | 6 library client; |
| 7 | 7 |
| 8 import 'dart:html'; | 8 import 'dart:html'; |
| 9 import 'dart:json' as jsonlib; | 9 import 'dart:convert'; |
| 10 // TODO(rnystrom): Use "package:" URL (#4968). | 10 // TODO(rnystrom): Use "package:" URL (#4968). |
| 11 import '../../classify.dart'; | 11 import '../../classify.dart'; |
| 12 import '../../markdown.dart' as md; | 12 import '../../markdown.dart' as md; |
| 13 import '../dartdoc/nav.dart'; | 13 import '../dartdoc/nav.dart'; |
| 14 import 'dropdown.dart'; | 14 import 'dropdown.dart'; |
| 15 import 'search.dart'; | 15 import 'search.dart'; |
| 16 import 'client-shared.dart'; | 16 import 'client-shared.dart'; |
| 17 | 17 |
| 18 main() { | 18 main() { |
| 19 setup(); | 19 setup(); |
| 20 | 20 |
| 21 // Request the navigation data so we can build the HTML for it. | 21 // Request the navigation data so we can build the HTML for it. |
| 22 HttpRequest.getString('${prefix}nav.json').then((text) { | 22 HttpRequest.getString('${prefix}nav.json').then((text) { |
| 23 var json = jsonlib.parse(text); | 23 var json = JSON.decode(text); |
| 24 buildNavigation(json); | 24 buildNavigation(json); |
| 25 setupSearch(json); | 25 setupSearch(json); |
| 26 }); | 26 }); |
| 27 } | 27 } |
| 28 | 28 |
| 29 | 29 |
| 30 /** | 30 /** |
| 31 * Takes [libraries], a JSON array representing a set of libraries and builds | 31 * Takes [libraries], a JSON array representing a set of libraries and builds |
| 32 * the appropriate navigation DOM for it relative to the current library and | 32 * the appropriate navigation DOM for it relative to the current library and |
| 33 * type. | 33 * type. |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 } | 88 } |
| 89 html.write('</li>'); | 89 html.write('</li>'); |
| 90 } | 90 } |
| 91 | 91 |
| 92 html.write('<ul class="icon">'); | 92 html.write('<ul class="icon">'); |
| 93 types.forEach((typeInfo) => | 93 types.forEach((typeInfo) => |
| 94 writeType(kindToString(typeInfo[KIND]), typeInfo)); | 94 writeType(kindToString(typeInfo[KIND]), typeInfo)); |
| 95 exceptions.forEach((typeInfo) => writeType('exception', typeInfo)); | 95 exceptions.forEach((typeInfo) => writeType('exception', typeInfo)); |
| 96 html.write('</ul>'); | 96 html.write('</ul>'); |
| 97 } | 97 } |
| OLD | NEW |