|
|
@@ -452,3 +452,177 @@ except ImportError, e:
|
|
|
})();
|
|
|
</script>
|
|
|
</%def>
|
|
|
+
|
|
|
+<%def name="aceKeyboardShortcuts()">
|
|
|
+ <script type="text/html" id="ace-keyboard-shortcuts-template">
|
|
|
+ <input class="clearable" type="text" placeholder="${ _('Search...')}" data-bind="clearable: query, value: query, valueUpdate: 'afterkeydown'">
|
|
|
+
|
|
|
+ <ul class="nav nav-tabs" data-bind="foreach: categories">
|
|
|
+ <li data-bind="css: { 'active': $parent.activeCategory().label === $data.label }, visible: filteredShortcuts().length > 0"><a href="javascript: void(0);" data-bind="click: function () { $parent.activeCategory($data); }, text: label"></a></li>
|
|
|
+ </ul>
|
|
|
+ <div class="tab-content" data-bind="with: activeCategory">
|
|
|
+ <div class="tab-pane active">
|
|
|
+ <table class="table">
|
|
|
+ <thead>
|
|
|
+ <tr>
|
|
|
+ <th>${ _('Windows/Linux')}</th>
|
|
|
+ <th>${ _('Mac')}</th>
|
|
|
+ <th>${ _('Action')}</th>
|
|
|
+ </tr>
|
|
|
+ </thead>
|
|
|
+ <tbody data-bind="foreach: filteredShortcuts">
|
|
|
+ <tr>
|
|
|
+ <td data-bind="text: shortcut"></td>
|
|
|
+ <td data-bind="text: macShortcut"></td>
|
|
|
+ <td data-bind="text: description"></td>
|
|
|
+ </tr>
|
|
|
+ </tbody>
|
|
|
+ </table>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ </script>
|
|
|
+
|
|
|
+ <script type="text/javascript" charset="utf-8">
|
|
|
+ (function () {
|
|
|
+
|
|
|
+ function AceKeyboardShortcutsViewModel () {
|
|
|
+ var self = this;
|
|
|
+
|
|
|
+ self.categories = [{
|
|
|
+ label: '${ _('Line Operations')}',
|
|
|
+ shortcuts: [{ shortcut: 'Ctrl-D', macShortcut: 'Command-D', description: '${ _('Remove line')}' },
|
|
|
+ { shortcut: 'Alt-Shift-Down', macShortcut: 'Command-Option-Down', description: '${ _('Copy lines down')}' },
|
|
|
+ { shortcut: 'Alt-Shift-Up', macShortcut: 'Command-Option-Up', description: '${ _('Copy lines up')}' },
|
|
|
+ { shortcut: 'Alt-Down', macShortcut: 'Option-Down', description: '${ _('Move lines down')}' },
|
|
|
+ { shortcut: 'Alt-Up', macShortcut: 'Option-Up', description: '${ _('Move lines up')}' },
|
|
|
+ { shortcut: 'Alt-Delete', macShortcut: 'Ctrl-K', description: '${ _('Remove to line end')}' },
|
|
|
+ { shortcut: 'Alt-Backspace', macShortcut: 'Command-Backspace', description: '${ _('Remove to line start')}' },
|
|
|
+ { shortcut: 'Ctrl-Backspace', macShortcut: 'Option-Backspace, Ctrl-Option-Backspace', description: '${ _('Remove word left')}' },
|
|
|
+ { shortcut: 'Ctrl-Delete', macShortcut: 'Option-Delete', description: '${ _('Remove word right')}' },
|
|
|
+ { shortcut: '---', macShortcut: 'Ctrl-O', description: '${ _('Split line')}' }]
|
|
|
+ },{
|
|
|
+ label: '${ _('Selection')}',
|
|
|
+ shortcuts: [{ shortcut: 'Ctrl-A', macShortcut: 'Command-A', description: '${ _('Select all')}' },
|
|
|
+ { shortcut: 'Shift-Left', macShortcut: 'Shift-Left', description: '${ _('Select left')}' },
|
|
|
+ { shortcut: 'Shift-Right', macShortcut: 'Shift-Right', description: '${ _('Select right')}' },
|
|
|
+ { shortcut: 'Ctrl-Shift-Left', macShortcut: 'Option-Shift-Left', description: '${ _('Select word left')}' },
|
|
|
+ { shortcut: 'Ctrl-Shift-Right', macShortcut: 'Option-Shift-Right', description: '${ _('Select word right')}' },
|
|
|
+ { shortcut: 'Shift-Home', macShortcut: 'Shift-Home', description: '${ _('Select line start')}' },
|
|
|
+ { shortcut: 'Shift-End', macShortcut: 'Shift-End', description: '${ _('Select line end')}' },
|
|
|
+ { shortcut: 'Alt-Shift-Right', macShortcut: 'Command-Shift-Right', description: '${ _('Select to line end')}' },
|
|
|
+ { shortcut: 'Alt-Shift-Left', macShortcut: 'Command-Shift-Left', description: '${ _('Select to line start')}' },
|
|
|
+ { shortcut: 'Shift-Up', macShortcut: 'Shift-Up', description: '${ _('Select up')}' },
|
|
|
+ { shortcut: 'Shift-Down', macShortcut: 'Shift-Down', description: '${ _('Select down')}' },
|
|
|
+ { shortcut: 'Shift-PageUp', macShortcut: 'Shift-PageUp', description: '${ _('Select page up')}' },
|
|
|
+ { shortcut: 'Shift-PageDown', macShortcut: 'Shift-PageDown', description: '${ _('Select page down')}' },
|
|
|
+ { shortcut: 'Ctrl-Shift-Home', macShortcut: 'Command-Shift-Up', description: '${ _('Select to start')}' },
|
|
|
+ { shortcut: 'Ctrl-Shift-End', macShortcut: 'Command-Shift-Down', description: '${ _('Select to end')}' },
|
|
|
+ { shortcut: 'Ctrl-Shift-D', macShortcut: 'Command-Shift-D', description: '${ _('Duplicate selection')}' },
|
|
|
+ { shortcut: 'Ctrl-Shift-P', macShortcut: '---', description: '${ _('Select to matching bracket')}' }]
|
|
|
+ },{
|
|
|
+ label: '${ _('Multi-cursor')}',
|
|
|
+ shortcuts: [{ shortcut: 'Ctrl-Alt-Up', macShortcut: 'Ctrl-Option-Up', description: '${ _('Add multi-cursor above')}' },
|
|
|
+ { shortcut: 'Ctrl-Alt-Down', macShortcut: 'Ctrl-Option-Down', description: '${ _('Add multi-cursor below')}' },
|
|
|
+ { shortcut: 'Ctrl-Alt-Right', macShortcut: 'Ctrl-Option-Right', description: '${ _('Add next occurrence to multi-selection')}' },
|
|
|
+ { shortcut: 'Ctrl-Alt-Left', macShortcut: 'Ctrl-Option-Left', description: '${ _('Add previous occurrence to multi-selection')}' },
|
|
|
+ { shortcut: 'Ctrl-Alt-Shift-Up', macShortcut: 'Ctrl-Option-Shift-Up', description: '${ _('Move multicursor from current line to the line above')}' },
|
|
|
+ { shortcut: 'Ctrl-Alt-Shift-Down', macShortcut: 'Ctrl-Option-Shift-Down', description: '${ _('Move multicursor from current line to the line below')}' },
|
|
|
+ { shortcut: 'Ctrl-Alt-Shift-Right', macShortcut: 'Ctrl-Option-Shift-Right', description: '${ _('Remove current occurrence from multi-selection and move to next')}' },
|
|
|
+ { shortcut: 'Ctrl-Alt-Shift-Left', macShortcut: 'Ctrl-Option-Shift-Left', description: '${ _('Remove current occurrence from multi-selection and move to previous')}' },
|
|
|
+ { shortcut: 'Ctrl-Shift-L', macShortcut: 'Ctrl-Shift-L', description: '${ _('Select all from multi-selection')}' }]
|
|
|
+ },{
|
|
|
+ label: '${ _('Go to')}',
|
|
|
+ shortcuts: [{ shortcut: 'Left', macShortcut: 'Left, Ctrl-B', description: '${ _('Go to left')}' },
|
|
|
+ { shortcut: 'Right', macShortcut: 'Right, Ctrl-F', description: '${ _('Go to right')}' },
|
|
|
+ { shortcut: 'Ctrl-Left', macShortcut: 'Option-Left', description: '${ _('Go to word left')}' },
|
|
|
+ { shortcut: 'Ctrl-Right', macShortcut: 'Option-Right', description: '${ _('Go to word right')}' },
|
|
|
+ { shortcut: 'Up', macShortcut: 'Up, Ctrl-P', description: '${ _('Go line up')}' },
|
|
|
+ { shortcut: 'Down', macShortcut: 'Down, Ctrl-N', description: '${ _('Go line down')}' },
|
|
|
+ { shortcut: 'Alt-Left, Home', macShortcut: 'Command-Left, Home, Ctrl-A', description: '${ _('Go to line start')}' },
|
|
|
+ { shortcut: 'Alt-Right, End', macShortcut: 'Command-Right, End, Ctrl-E', description: '${ _('Go to line end')}' },
|
|
|
+ { shortcut: 'PageUp', macShortcut: 'Option-PageUp', description: '${ _('Go to page up')}' },
|
|
|
+ { shortcut: 'PageDown', macShortcut: 'Option-PageDown, Ctrl-V', description: '${ _('Go to page down')}' },
|
|
|
+ { shortcut: 'Ctrl-Home', macShortcut: 'Command-Home, Command-Up', description: '${ _('Go to start')}' },
|
|
|
+ { shortcut: 'Ctrl-End', macShortcut: 'Command-End, Command-Down', description: '${ _('Go to end')}' },
|
|
|
+ { shortcut: 'Ctrl-L, Ctrl-J', macShortcut: 'Command-L, Command-J', description: '${ _('Go to line')}' },
|
|
|
+ { shortcut: 'Ctrl-Down', macShortcut: 'Command-Down', description: '${ _('Scroll line down')}' },
|
|
|
+ { shortcut: 'Ctrl-Up', macShortcut: '---', description: '${ _('Scroll line up')}' },
|
|
|
+ { shortcut: 'Ctrl-P', macShortcut: '---', description: '${ _('Go to matching bracket')}' },
|
|
|
+ { shortcut: '---', macShortcut: 'Option-PageDown', description: '${ _('Scroll page down')}' },
|
|
|
+ { shortcut: '---', macShortcut: 'Option-PageUp', description: '${ _('Scroll page up')}' }]
|
|
|
+ },{
|
|
|
+ label: '${ _('Find/Replace')}',
|
|
|
+ shortcuts: [{ shortcut: 'Ctrl-F', macShortcut: 'Command-F', description: '${ _('Find')}' },
|
|
|
+ { shortcut: 'Ctrl-H', macShortcut: 'Command-Option-F', description: '${ _('Replace')}' },
|
|
|
+ { shortcut: 'Ctrl-K', macShortcut: 'Command-G', description: '${ _('Find next')}' },
|
|
|
+ { shortcut: 'Ctrl-Shift-K', macShortcut: 'Command-Shift-G', description: '${ _('Find previous')}' }]
|
|
|
+ },{
|
|
|
+ label: '${ _('Folding')}',
|
|
|
+ shortcuts: [{ shortcut: 'Alt-L, Ctrl-F1', macShortcut: 'Command-Option-L, Command-F1', description: '${ _('Fold selection')}' },
|
|
|
+ { shortcut: 'Alt-Shift-L, Ctrl-Shift-F1', macShortcut: 'Command-Option-Shift-L, Command-Shift-F1', description: '${ _('Unfold')}' },
|
|
|
+ { shortcut: 'Alt-0', macShortcut: 'Command-Option-0', description: '${ _('Fold all')}' },
|
|
|
+ { shortcut: 'Alt-Shift-0', macShortcut: 'Command-Option-Shift-0', description: '${ _('Unfold all')}' }]
|
|
|
+ },{
|
|
|
+ label: '${ _('Other')}',
|
|
|
+ shortcuts: [{ shortcut: 'Ctrl-Space', macShortcut: 'Ctrl-Space', description: '${ _('Autocomplete when Live Autocompletion is off')}' },
|
|
|
+ { shortcut: 'Ctrl-i|Ctrl-Shift-f', macShortcut: 'Command-i|Command-Shift-f', description: '${ _('Format selection or all')}' },
|
|
|
+ { shortcut: 'Tab', macShortcut: 'Tab', description: '${ _('Indent')}' },
|
|
|
+ { shortcut: 'Shift-Tab', macShortcut: 'Shift-Tab', description: '${ _('Outdent')}' },
|
|
|
+ { shortcut: 'Ctrl-Z', macShortcut: 'Command-Z', description: '${ _('Undo')}' },
|
|
|
+ { shortcut: 'Ctrl-Shift-Z, Ctrl-Y', macShortcut: 'Command-Shift-Z, Command-Y', description: '${ _('Redo')}' },
|
|
|
+ { shortcut: 'Ctrl-/', macShortcut: 'Command-/', description: '${ _('Toggle comment')}' },
|
|
|
+ { shortcut: 'Ctrl-T', macShortcut: 'Ctrl-T', description: '${ _('Transpose letters')}' },
|
|
|
+ { shortcut: 'Ctrl-Shift-U', macShortcut: 'Ctrl-Shift-U', description: '${ _('Change to lower case')}' },
|
|
|
+ { shortcut: 'Ctrl-U', macShortcut: 'Ctrl-U', description: '${ _('Change to upper case')}' },
|
|
|
+ { shortcut: 'Insert', macShortcut: 'Insert', description: '${ _('Overwrite')}' },
|
|
|
+ { shortcut: 'Ctrl-Shift-E', macShortcut: 'Command-Shift-E', description: '${ _('Macros replay')}' },
|
|
|
+ { shortcut: 'Ctrl-Alt-E', macShortcut: '---', description: '${ _('Macros recording')}' },
|
|
|
+ { shortcut: 'Delete', macShortcut: '---', description: '${ _('Delete')}' },
|
|
|
+ { shortcut: '---', macShortcut: 'Ctrl-L', description: '${ _('Center selection')}' }]
|
|
|
+ },{
|
|
|
+ id: 'settings',
|
|
|
+ label: '${ _('Settings')}',
|
|
|
+ shortcuts: [{ shortcut: 'Ctrl - ,', macShortcut: 'Command - ,', description: '${ _('Show the settings menu')}' }]
|
|
|
+ }];
|
|
|
+
|
|
|
+ self.query = ko.observable('');
|
|
|
+
|
|
|
+ self.activeCategory = ko.observable(self.categories[0]);
|
|
|
+
|
|
|
+ self.categories.forEach(function (category) {
|
|
|
+ category.filteredShortcuts = ko.pureComputed(function () {
|
|
|
+ var query = (self.query() || '').toLowerCase();
|
|
|
+ if (query !== '') {
|
|
|
+ var result = $.grep(category.shortcuts, function (shortcut) {
|
|
|
+ return shortcut.description.toLowerCase().indexOf(query) !== -1;
|
|
|
+ });
|
|
|
+ return result;
|
|
|
+ } else {
|
|
|
+ return category.shortcuts;
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ category.filteredShortcuts.subscribe(function (newVal) {
|
|
|
+ if (category === self.activeCategory() && newVal.length === 0) {
|
|
|
+ self.categories.every(function (category) {
|
|
|
+ if (category.filteredShortcuts().length > 0) {
|
|
|
+ self.activeCategory(category);
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+ });
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ ko.components.register('aceKeyboardShortcuts', {
|
|
|
+ viewModel: AceKeyboardShortcutsViewModel,
|
|
|
+ template: { element: 'ace-keyboard-shortcuts-template' }
|
|
|
+ });
|
|
|
+ })();
|
|
|
+ </script>
|
|
|
+</%def>
|