Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(46)

Unified Diff: pkg/dartdoc/client-shared.dart

Issue 10919260: Reorganize dartdoc to new package layout. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/dartdoc/client-live-nav.dart ('k') | pkg/dartdoc/client-static.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/dartdoc/client-shared.dart
diff --git a/pkg/dartdoc/client-shared.dart b/pkg/dartdoc/client-shared.dart
deleted file mode 100644
index 41ebe288d6c6635f0bb4116d18ae0ae398cf7abb..0000000000000000000000000000000000000000
--- a/pkg/dartdoc/client-shared.dart
+++ /dev/null
@@ -1,74 +0,0 @@
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-// Code shared between the different client-side libraries.
-
-// The names of the library and type that this page documents.
-String currentLibrary = null;
-String currentType = null;
-
-// What we need to prefix relative URLs with to get them to work.
-String prefix = '';
-
-void setupLocation() {
- // Figure out where we are.
- final body = document.query('body');
- currentLibrary = body.dataAttributes['library'];
- currentType = body.dataAttributes['type'];
- prefix = (currentType != null) ? '../' : '';
-}
-
-/**
- * Finds all code blocks and makes them toggleable. Syntax highlights each
- * code block the first time it's shown.
- */
-enableCodeBlocks() {
- for (var elem in document.queryAll('.method, .field')) {
- var showCode = elem.query('.show-code');
-
- // Skip it if we don't have a code link. Will happen if source code is
- // disabled.
- if (showCode == null) continue;
-
- var pre = elem.query('pre.source');
-
- showCode.on.click.add((e) {
- if (pre.classes.contains('expanded')) {
- pre.classes.remove('expanded');
- } else {
- // Syntax highlight.
- if (!pre.classes.contains('formatted')) {
- pre.innerHTML = classifySource(pre.text);
- pre.classes.add('formatted');
- };
- pre.classes.add('expanded');
- }
- });
- }
-}
-
-
-/** Turns [name] into something that's safe to use as a file name. */
-String sanitize(String name) => name.replaceAll(':', '_').replaceAll('/', '_');
-
-String getTypeName(Map typeInfo) =>
- typeInfo.containsKey('args')
- ? '${typeInfo[NAME]}<${typeInfo[NAME]}>'
- : typeInfo[NAME];
-
-String getLibraryUrl(String libraryName) =>
- '$prefix${sanitize(libraryName)}.html';
-
-String getTypeUrl(String libraryName, Map typeInfo) =>
- '$prefix${sanitize(libraryName)}/${sanitize(typeInfo[NAME])}.html';
-
-String getLibraryMemberUrl(String libraryName, Map memberInfo) =>
- '$prefix${sanitize(libraryName)}.html#${getMemberAnchor(memberInfo)}';
-
-String getTypeMemberUrl(String libraryName, String typeName, Map memberInfo) =>
- '$prefix${sanitize(libraryName)}/${sanitize(typeName)}.html#'
- '${getMemberAnchor(memberInfo)}';
-
-String getMemberAnchor(Map memberInfo) => memberInfo.containsKey(LINK_NAME)
- ? memberInfo[LINK_NAME] : memberInfo[NAME];
« no previous file with comments | « pkg/dartdoc/client-live-nav.dart ('k') | pkg/dartdoc/client-static.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698