Wiki source code of KeyboardShortcuts
Version 2.5 by Silvia Macovei on 2009/10/08
Show last authors
author | version | line-number | content |
---|---|---|---|
1 | = XWiki Keyboard Shortcuts = | ||
2 | |||
3 | {{toc start=2 depth=6 numbered=false scope=page /}} | ||
4 | |||
5 | **Since XWiki Enterprise version 1.4M1**, you can use keyboard shortcuts to use some XWiki features. Keyboard shortcuts help you save time since you never have to take your hands off the keyboard to use the mouse. | ||
6 | |||
7 | == Shortcuts == | ||
8 | |||
9 | === View mode === | ||
10 | |||
11 | {{info}}View keyboard shortcuts are only available to advanced users, preventing simple users to get unexpected behavior when pressing keyboard keys by mistake{{/info}} | ||
12 | |||
13 | ==== Edit ==== | ||
14 | |||
15 | {{velocity filter="none"}} | ||
16 | (% style="width:400px;"%) | ||
17 | |**e** |Edit the page using the default edition mode | ||
18 | |**k** |Edit the page in wiki edition mode | ||
19 | |**g** |Edit the page using the WYSIWYG editor | ||
20 | |**f** |Inline Form | ||
21 | |**r** |Edit page access rights | ||
22 | |**o** |Edit page objects | ||
23 | |**s** |Edit class | ||
24 | |||
25 | ==== Show ==== | ||
26 | |||
27 | (% style="width:400px;"%) | ||
28 | |**c** |Go to page comments | ||
29 | |**a** |Go to page attachments | ||
30 | |**h** |Go to page history | ||
31 | |**d** |View page wiki code | ||
32 | |||
33 | ==== Actions ==== | ||
34 | |||
35 | (% style="width:400px;"%) | ||
36 | |**F2** |Rename page | ||
37 | |**Delete** |Delete page | ||
38 | |||
39 | === Edit & inline mode === | ||
40 | |||
41 | {{warning}}Keyboard shortcuts aren't available from the wysiwyg edit mode (since the wysiwyg editor grabs all the key pressed events){{/warning}} | ||
42 | (% style="width:400px;"%) | ||
43 | |**<Alt> + c** |Cancel edition | ||
44 | |**<Alt> + p** |Preview the page without saving | ||
45 | |**<Alt> + <Shift> + s** |Save and continue to edit the page | ||
46 | |**<Alt> + s** |Save and view the page | ||
47 | |||
48 | === Preview mode === | ||
49 | |||
50 | (% style="width:400px;"%) | ||
51 | |**<Alt> + c** |Cancel edition | ||
52 | |**<Alt> + b** |Back to the edition | ||
53 | |**<Alt> + <Shift> + s** |Save and continue to edit the page | ||
54 | |**<Alt> + s** |Save and view the page | ||
55 | |||
56 | == Adding your own shortcuts == | ||
57 | |||
58 | You can add your own keyboard shortcuts in a few javascript lines : | ||
59 | |||
60 | {{code language="javascript"}} | ||
61 | <script type="text/javascript"> | ||
62 | //<![CDATA[ | ||
63 | shortcut.add("Ctrl+Alt+Shift+N", function() { alert("Hey there! Congratulations on typing this one ;)"); }); | ||
64 | //]]> | ||
65 | </script> | ||
66 | {{/code}} | ||
67 | |||
68 | ## commented since XWiki.org version < 1.4 | ||
69 | #* | ||
70 | {pre} | ||
71 | <script type="text/javascript"> | ||
72 | shortcut.add("Ctrl+Alt+Shift+N", function() { alert("Hey there! Congratulations on typing this one ;)"); }, {'propagate':false} ); | ||
73 | </script> | ||
74 | {/pre} | ||
75 | Try the snippet by pressing Ctrl+Alt+N. | ||
76 | *# | ||
77 | [[Complete documentation>>http://www.openjs.com/scripts/events/keyboard_shortcuts/]]. | ||
78 | |||
79 | == Removing shortcuts == | ||
80 | |||
81 | To remove a shortcut adapt this snippet to your needs : | ||
82 | |||
83 | {{code language="javascript"}} | ||
84 | <script type="text/javascript"> | ||
85 | //<![CDATA[ | ||
86 | shortcut.remove("Ctrl+Alt+Shift+N"); | ||
87 | //]]> | ||
88 | </script> | ||
89 | {{/code}} | ||
90 | |||
91 | ## commented since XWiki.org version < 1.4 | ||
92 | #* | ||
93 | {pre} | ||
94 | <script type="text/javascript"> | ||
95 | funtion removeCtrlAltShiftN() { | ||
96 | shortcut.remove("Ctrl+Alt+Shift+N"); | ||
97 | } | ||
98 | </script> | ||
99 | {/pre} | ||
100 | |||
101 | <a onclick="removeCtrlAltShiftN();">Click here to try the snippet, will remove the Ctrl+Alt+Shift+N shortcut</a>. | ||
102 | *# | ||
103 | {{/velocity}} | ||
104 | |||
105 | == i18n == | ||
106 | |||
107 | All the core XWiki shortcuts can be modified in the xwiki-core application resources (core.shortcuts.*) | ||
108 | |||
109 | == Credits == | ||
110 | |||
111 | XWiki keyboard shortcuts are powered by [[openjs.org shortcut library>>http://www.openjs.com/scripts/events/keyboard_shortcuts/]]. |