Wiki source code of KeyboardShortcuts
Version 5.1 by Jean-Vincent Drean on 2009/12/10
Hide last authors
author | version | line-number | content |
---|---|---|---|
![]() |
2.1 | 1 | = XWiki Keyboard Shortcuts = |
![]() |
1.1 | 2 | |
![]() |
2.4 | 3 | {{toc start=2 depth=6 numbered=false scope=page /}} |
![]() |
1.1 | 4 | |
![]() |
2.1 | 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. |
![]() |
1.1 | 6 | |
![]() |
2.1 | 7 | == Shortcuts == |
![]() |
1.1 | 8 | |
![]() |
2.1 | 9 | === View mode === |
![]() |
1.1 | 10 | |
![]() |
2.1 | 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}} |
![]() |
1.1 | 12 | |
![]() |
2.1 | 13 | ==== Edit ==== |
![]() |
1.1 | 14 | |
![]() |
2.3 | 15 | (% style="width:400px;"%) |
16 | |**e** |Edit the page using the default edition mode | ||
17 | |**k** |Edit the page in wiki edition mode | ||
18 | |**g** |Edit the page using the WYSIWYG editor | ||
19 | |**f** |Inline Form | ||
20 | |**r** |Edit page access rights | ||
21 | |**o** |Edit page objects | ||
22 | |**s** |Edit class | ||
![]() |
1.1 | 23 | |
![]() |
2.1 | 24 | ==== Show ==== |
![]() |
1.1 | 25 | |
![]() |
2.3 | 26 | (% style="width:400px;"%) |
27 | |**c** |Go to page comments | ||
28 | |**a** |Go to page attachments | ||
29 | |**h** |Go to page history | ||
30 | |**d** |View page wiki code | ||
![]() |
1.1 | 31 | |
![]() |
2.1 | 32 | ==== Actions ==== |
![]() |
1.1 | 33 | |
![]() |
2.3 | 34 | (% style="width:400px;"%) |
35 | |**F2** |Rename page | ||
36 | |**Delete** |Delete page | ||
![]() |
1.1 | 37 | |
![]() |
2.1 | 38 | === Edit & inline mode === |
![]() |
1.1 | 39 | |
![]() |
2.1 | 40 | {{warning}}Keyboard shortcuts aren't available from the wysiwyg edit mode (since the wysiwyg editor grabs all the key pressed events){{/warning}} |
![]() |
2.3 | 41 | (% style="width:400px;"%) |
42 | |**<Alt> + c** |Cancel edition | ||
43 | |**<Alt> + p** |Preview the page without saving | ||
44 | |**<Alt> + <Shift> + s** |Save and continue to edit the page | ||
45 | |**<Alt> + s** |Save and view the page | ||
![]() |
1.1 | 46 | |
![]() |
2.1 | 47 | === Preview mode === |
![]() |
1.1 | 48 | |
![]() |
2.3 | 49 | (% style="width:400px;"%) |
50 | |**<Alt> + c** |Cancel edition | ||
51 | |**<Alt> + b** |Back to the edition | ||
52 | |**<Alt> + <Shift> + s** |Save and continue to edit the page | ||
53 | |**<Alt> + s** |Save and view the page | ||
![]() |
1.1 | 54 | |
![]() |
2.1 | 55 | == Adding your own shortcuts == |
![]() |
1.1 | 56 | |
57 | You can add your own keyboard shortcuts in a few javascript lines : | ||
58 | |||
![]() |
2.1 | 59 | {{code language="javascript"}} |
![]() |
1.1 | 60 | <script type="text/javascript"> |
61 | //<![CDATA[ | ||
62 | shortcut.add("Ctrl+Alt+Shift+N", function() { alert("Hey there! Congratulations on typing this one ;)"); }); | ||
63 | //]]> | ||
64 | </script> | ||
![]() |
2.1 | 65 | {{/code}} |
![]() |
1.1 | 66 | |
![]() |
5.1 | 67 | {{html}} |
![]() |
1.1 | 68 | <script type="text/javascript"> |
69 | shortcut.add("Ctrl+Alt+Shift+N", function() { alert("Hey there! Congratulations on typing this one ;)"); }, {'propagate':false} ); | ||
70 | </script> | ||
![]() |
5.1 | 71 | {{/html}} |
72 | |||
![]() |
1.1 | 73 | Try the snippet by pressing Ctrl+Alt+N. |
![]() |
5.1 | 74 | |
![]() |
2.1 | 75 | [[Complete documentation>>http://www.openjs.com/scripts/events/keyboard_shortcuts/]]. |
![]() |
1.1 | 76 | |
![]() |
2.1 | 77 | == Removing shortcuts == |
![]() |
1.1 | 78 | |
79 | To remove a shortcut adapt this snippet to your needs : | ||
80 | |||
![]() |
2.1 | 81 | {{code language="javascript"}} |
![]() |
1.1 | 82 | <script type="text/javascript"> |
83 | //<![CDATA[ | ||
84 | shortcut.remove("Ctrl+Alt+Shift+N"); | ||
85 | //]]> | ||
86 | </script> | ||
![]() |
2.1 | 87 | {{/code}} |
![]() |
1.1 | 88 | |
![]() |
5.1 | 89 | {{html}} |
![]() |
1.1 | 90 | <script type="text/javascript"> |
91 | funtion removeCtrlAltShiftN() { | ||
92 | shortcut.remove("Ctrl+Alt+Shift+N"); | ||
93 | } | ||
94 | </script> | ||
95 | <a onclick="removeCtrlAltShiftN();">Click here to try the snippet, will remove the Ctrl+Alt+Shift+N shortcut</a>. | ||
![]() |
5.1 | 96 | {{/html}} |
![]() |
1.1 | 97 | |
![]() |
5.1 | 98 | == Removing all shortcuts at once == |
99 | |||
100 | {{code language="javascript"}} | ||
101 | <script type="text/javascript"> | ||
102 | //<![CDATA[ | ||
103 | for (binding in shortcut.all_shortcuts) { | ||
104 | shortcut.remove(binding); | ||
105 | } | ||
106 | //]]> | ||
107 | </script> | ||
108 | {{/code}} | ||
109 | |||
110 | {{velocity}} | ||
111 | #if (!$isGuest) | ||
112 | {{html}} | ||
113 | <script type="text/javascript"> | ||
114 | //<![CDATA[ | ||
115 | for (binding in shortcut.all_shortcuts) { | ||
116 | shortcut.remove(binding); | ||
117 | } | ||
118 | //]]> | ||
119 | </script> | ||
120 | {{/html}} | ||
121 | #end | ||
122 | {{velocity}} | ||
123 | |||
![]() |
2.1 | 124 | == i18n == |
![]() |
1.1 | 125 | |
126 | All the core XWiki shortcuts can be modified in the xwiki-core application resources (core.shortcuts.*) | ||
127 | |||
![]() |
2.1 | 128 | == Credits == |
![]() |
1.1 | 129 | |
![]() |
2.1 | 130 | XWiki keyboard shortcuts are powered by [[openjs.org shortcut library>>http://www.openjs.com/scripts/events/keyboard_shortcuts/]]. |