// Copyright (c) 2011, 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. // @dart = 2.9 part of swarmlib; /// An informational dialog that shows keyboard shortcuts and provides a /// link to the Dart language webpage. //TODO(efortuna): fix DialogView so it doesn't require the HTML passed to // the constructor. class HelpDialog extends DialogView { final CompositeView _parent; final Function _doneHandler; HelpDialog(this._parent, this._doneHandler) : super('Information', '', makeContent()); @override void onDone() { _doneHandler(); } static View makeContent() { return View.html('''

Keyboard shortcuts: ${generateTableHtml()}

'''); } static String generateTableHtml() { String cellStart = ''''''; return ''' $cellStart Shortcut Key $cellStart Action $cellStart j, <down arrow> $cellStart Next Article $cellStart k, <up arrow> $cellStart Previous Article $cellStart o, <enter> $cellStart Open Article $cellStart <esc>, <delete> $cellStart Back $cellStart a, h, <left arrow> $cellStart Left $cellStart d, l, <right arrow> $cellStart Right $cellStart n $cellStart Next Category $cellStart p $cellStart Previous Category
'''; } }