mirror of
https://github.com/BookStackApp/BookStack.git
synced 2024-08-26 04:05:57 +00:00
Added ctrl+shift+k shortcut to WYSIWYG
Shows entity select dialog for more direct entity link insertion. Aligns with shortcut from markdown editor. For #3244
This commit is contained in:
parent
1253711c7d
commit
20ecaa5c5a
@ -39,4 +39,19 @@ export function register(editor) {
|
|||||||
|
|
||||||
editor.formatter.apply('callout' + newFormat);
|
editor.formatter.apply('callout' + newFormat);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Link selector shortcut
|
||||||
|
editor.shortcuts.add('meta+shift+K', '', function() {
|
||||||
|
window.EntitySelectorPopup.show(function(entity) {
|
||||||
|
|
||||||
|
if (editor.selection.isCollapsed()) {
|
||||||
|
editor.insertContent(editor.dom.createHTML('a', {href: entity.link}, editor.dom.encode(entity.name)));
|
||||||
|
} else {
|
||||||
|
editor.formatter.apply('link', {href: entity.link});
|
||||||
|
}
|
||||||
|
|
||||||
|
editor.selection.collapse(false);
|
||||||
|
editor.focus();
|
||||||
|
})
|
||||||
|
});
|
||||||
}
|
}
|
@ -145,6 +145,7 @@ return [
|
|||||||
'editor_tiny_license_link' => 'The copyright and license details of TinyMCE can be found here.',
|
'editor_tiny_license_link' => 'The copyright and license details of TinyMCE can be found here.',
|
||||||
'save_continue' => 'Save Page & Continue',
|
'save_continue' => 'Save Page & Continue',
|
||||||
'callouts_cycle' => '(Keep pressing to toggle through types)',
|
'callouts_cycle' => '(Keep pressing to toggle through types)',
|
||||||
|
'link_selector' => 'Link to content',
|
||||||
'shortcuts' => 'Shortcuts',
|
'shortcuts' => 'Shortcuts',
|
||||||
'shortcut' => 'Shortcut',
|
'shortcut' => 'Shortcut',
|
||||||
'shortcuts_intro' => 'The following shortcuts are available in the editor:',
|
'shortcuts_intro' => 'The following shortcuts are available in the editor:',
|
||||||
|
@ -115,6 +115,15 @@
|
|||||||
{{ trans('editor.callouts_cycle') }}
|
{{ trans('editor.callouts_cycle') }}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<code>Ctrl</code>+<code>Shift</code>+<code>K</code>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<code>Cmd</code>+<code>Shift</code>+<code>K</code>
|
||||||
|
</td>
|
||||||
|
<td>{{ trans('editor.link_selector') }}</td>
|
||||||
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user