| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 /// Templates used for the HTML visualization of source map information. | 5 /// Templates used for the HTML visualization of source map information. |
| 6 | 6 |
| 7 library sourcemap.html.templates; | 7 library sourcemap.html.templates; |
| 8 | 8 |
| 9 import 'dart:io'; | 9 import 'dart:io'; |
| 10 | 10 |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 width:100%; | 141 width:100%; |
| 142 top:50%; | 142 top:50%; |
| 143 height:50%; | 143 height:50%; |
| 144 } | 144 } |
| 145 '''; | 145 '''; |
| 146 outputInTemplate(uri, html, css); | 146 outputInTemplate(uri, html, css); |
| 147 } | 147 } |
| 148 | 148 |
| 149 /// Outputs [html] with customized [css] in [uri]. | 149 /// Outputs [html] with customized [css] in [uri]. |
| 150 void outputInTemplate(Uri uri, String html, String css) { | 150 void outputInTemplate(Uri uri, String html, String css) { |
| 151 output( | 151 output(uri, ''' |
| 152 uri, | |
| 153 ''' | |
| 154 <html> | 152 <html> |
| 155 <head> | 153 <head> |
| 156 <style> | 154 <style> |
| 157 a, a:hover { | 155 a, a:hover { |
| 158 text-decoration: none; | 156 text-decoration: none; |
| 159 color: #000; | 157 color: #000; |
| 160 } | 158 } |
| 161 h3 { | 159 h3 { |
| 162 cursor: pointer; | 160 cursor: pointer; |
| 163 } | 161 } |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 236 </body> | 234 </body> |
| 237 </html> | 235 </html> |
| 238 '''); | 236 '''); |
| 239 } | 237 } |
| 240 | 238 |
| 241 /// Outputs [html] in [uri]. | 239 /// Outputs [html] in [uri]. |
| 242 void output(Uri uri, String html) { | 240 void output(Uri uri, String html) { |
| 243 File outputFile = new File.fromUri(uri); | 241 File outputFile = new File.fromUri(uri); |
| 244 outputFile.writeAsStringSync(html); | 242 outputFile.writeAsStringSync(html); |
| 245 } | 243 } |
| OLD | NEW |