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

Side by Side Diff: client/samples/swarm/HelpDialog.dart

Issue 9314024: Final CL to kill off client/samples . (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 10 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « client/samples/swarm/Decoder.dart ('k') | client/samples/swarm/README » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
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.
4
5 /**
6 * An informational dialog that shows keyboard shortcuts and provides a
7 * link to the Dart language webpage.
8 */
9 //TODO(efortuna): fix DialogView so it doesn't require the HTML passed to
10 // the constructor.
11 class HelpDialog extends DialogView {
12 CompositeView _parent;
13 Function _doneHandler;
14
15 HelpDialog(this._parent, this._doneHandler)
16 : super('Information', '', makeContent());
17
18 void onDone() { _doneHandler(); }
19
20 static View makeContent() {
21 return new View.html(
22 '''
23 <div>
24
25 <p>
26 Keyboard shortcuts:
27 ${generateTableHtml()}
28 </p>
29
30 <p>
31 <div id="dart-logo">
32 <a href="http://dartlang.org">
33 Dart, the programming language</a>.
34 </div>
35 </p>
36 </div>
37 ''');
38 }
39
40 static String generateTableHtml() {
41 String cellStart = '''<th valign="middle" align="center">''';
42 return '''<table width="90%" border=1 cellspacing="0" cellpadding="2">
43 <tr bgcolor="#c3d9ff">
44 ${cellStart} Shortcut Key </th>
45 ${cellStart} Action </th>
46 </tr>
47 <tr>
48 ${cellStart} j, &lt;down arrow&gt; </th>
49 ${cellStart} Next Article </th>
50 </tr>
51 <tr>
52 ${cellStart} k, &lt;up arrow&gt; </th>
53 ${cellStart} Previous Article </th>
54 </tr>
55 <tr>
56 ${cellStart} o, &lt;enter&gt; </th>
57 ${cellStart} Open Article </th>
58 </tr>
59 <tr>
60 ${cellStart} &lt;esc&gt;, &lt;delete&gt; </th>
61 ${cellStart} Back </th>
62 </tr>
63 <tr>
64 ${cellStart} a, h, &lt;left arrow&gt; </th>
65 ${cellStart} Left </th>
66 </tr>
67 <tr>
68 ${cellStart} d, l, &lt;right arrow&gt; </th>
69 ${cellStart} Right </th>
70 </tr>
71 <tr>
72 ${cellStart} n </th>
73 ${cellStart} Next Category </th>
74 </tr>
75 <tr>
76 ${cellStart} p </th>
77 ${cellStart} Previous Category </th>
78 </tr>
79
80 </table>''';
81 }
82 }
OLDNEW
« no previous file with comments | « client/samples/swarm/Decoder.dart ('k') | client/samples/swarm/README » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698