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

Unified Diff: utils/dartdoc/interact.dart

Issue 9004030: Syntax highlighting on the client. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 9 years 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 | « utils/dartdoc/dartdoc.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: utils/dartdoc/interact.dart
diff --git a/utils/dartdoc/interact.dart b/utils/dartdoc/interact.dart
index 81c7b226eaed098048c7b7283350095633a667f1..1aecdb2ba9bcb525ca84696811099eacb07f8a90 100644
--- a/utils/dartdoc/interact.dart
+++ b/utils/dartdoc/interact.dart
@@ -6,6 +6,10 @@
#library('interact');
#import('dart:html');
+#import('../../frog/lang.dart');
+#import('markdown.dart', prefix: 'md');
+
+#source('classify.dart');
main() {
window.on.contentLoaded.add((e) {
@@ -21,9 +25,14 @@ main() {
if (pre.classes.contains('expanded')) {
pre.classes.remove('expanded');
} else {
+ // Syntax highlight.
+ if (!pre.classes.contains('formatted')) {
+ pre.innerHTML = classifySource(new SourceFile('', pre.text));
+ pre.classes.add('formatted');
+ };
pre.classes.add('expanded');
}
});
}
});
-}
+}
« no previous file with comments | « utils/dartdoc/dartdoc.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698