Wiki source code of KeyboardShortcuts

Version 3.1 by Jean-Vincent Drean on 2009/12/10

Hide last authors
Silvia Macovei 2.1 1 = XWiki Keyboard Shortcuts =
Jean-Vincent Drean 1.1 2
Silvia Macovei 2.4 3 {{toc start=2 depth=6 numbered=false scope=page /}}
Jean-Vincent Drean 1.1 4
Silvia Macovei 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.
Jean-Vincent Drean 1.1 6
Silvia Macovei 2.1 7 == Shortcuts ==
Jean-Vincent Drean 1.1 8
Silvia Macovei 2.1 9 === View mode ===
Jean-Vincent Drean 1.1 10
Silvia Macovei 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}}
Jean-Vincent Drean 1.1 12
Silvia Macovei 2.1 13 ==== Edit ====
Jean-Vincent Drean 1.1 14
Silvia Macovei 2.1 15 {{velocity filter="none"}}
Silvia Macovei 2.3 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
Jean-Vincent Drean 1.1 24
Silvia Macovei 2.1 25 ==== Show ====
Jean-Vincent Drean 1.1 26
Silvia Macovei 2.3 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
Jean-Vincent Drean 1.1 32
Silvia Macovei 2.1 33 ==== Actions ====
Jean-Vincent Drean 1.1 34
Silvia Macovei 2.3 35 (% style="width:400px;"%)
36 |**F2** |Rename page
37 |**Delete** |Delete page
Jean-Vincent Drean 1.1 38
Silvia Macovei 2.1 39 === Edit & inline mode ===
Jean-Vincent Drean 1.1 40
Silvia Macovei 2.1 41 {{warning}}Keyboard shortcuts aren't available from the wysiwyg edit mode (since the wysiwyg editor grabs all the key pressed events){{/warning}}
Silvia Macovei 2.3 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
Jean-Vincent Drean 1.1 47
Silvia Macovei 2.1 48 === Preview mode ===
Jean-Vincent Drean 1.1 49
Silvia Macovei 2.3 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
Jean-Vincent Drean 1.1 55
Silvia Macovei 2.1 56 == Adding your own shortcuts ==
Jean-Vincent Drean 1.1 57
58 You can add your own keyboard shortcuts in a few javascript lines :
59
Silvia Macovei 2.1 60 {{code language="javascript"}}
Jean-Vincent Drean 1.1 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>
Silvia Macovei 2.1 66 {{/code}}
Jean-Vincent Drean 1.1 67
Jean-Vincent Drean 3.1 68 {{html}}
Jean-Vincent Drean 1.1 69 <script type="text/javascript">
70 shortcut.add("Ctrl+Alt+Shift+N", function() { alert("Hey there! Congratulations on typing this one ;)"); }, {'propagate':false} );
71 </script>
Jean-Vincent Drean 3.1 72 {{/html}}
73
Jean-Vincent Drean 1.1 74 Try the snippet by pressing Ctrl+Alt+N.
Jean-Vincent Drean 3.1 75
Silvia Macovei 2.1 76 [[Complete documentation>>http://www.openjs.com/scripts/events/keyboard_shortcuts/]].
Jean-Vincent Drean 1.1 77
Silvia Macovei 2.1 78 == Removing shortcuts ==
Jean-Vincent Drean 1.1 79
80 To remove a shortcut adapt this snippet to your needs :
81
Silvia Macovei 2.1 82 {{code language="javascript"}}
Jean-Vincent Drean 1.1 83 <script type="text/javascript">
84 //<![CDATA[
85 shortcut.remove("Ctrl+Alt+Shift+N");
86 //]]>
87 </script>
Silvia Macovei 2.1 88 {{/code}}
Jean-Vincent Drean 1.1 89
Jean-Vincent Drean 3.1 90 {{html}}
Jean-Vincent Drean 1.1 91 <script type="text/javascript">
92 funtion removeCtrlAltShiftN() {
93 shortcut.remove("Ctrl+Alt+Shift+N");
94 }
95 </script>
Jean-Vincent Drean 3.1 96 <a onclick="removeCtrlAltShiftN();">Click here to try the snippet, will remove the Ctrl+Alt+Shift+N shortcut</a>.
97 {{/html}}
Jean-Vincent Drean 1.1 98
Jean-Vincent Drean 3.1 99 == Removing all shortcuts at once ==
100
101 = XWiki Keyboard Shortcuts =
102
103 {{toc start=2 depth=6 numbered=false scope=page /}}
104
105 **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.
106
107 == Shortcuts ==
108
109 === View mode ===
110
111 {{info}}View keyboard shortcuts are only available to advanced users, preventing simple users to get unexpected behavior when pressing keyboard keys by mistake{{/info}}
112
113 ==== Edit ====
114
115 {{velocity filter="none"}}
116 (% style="width:400px;"%)
117 |**e** |Edit the page using the default edition mode
118 |**k** |Edit the page in wiki edition mode
119 |**g** |Edit the page using the WYSIWYG editor
120 |**f** |Inline Form
121 |**r** |Edit page access rights
122 |**o** |Edit page objects
123 |**s** |Edit class
124
125 ==== Show ====
126
127 (% style="width:400px;"%)
128 |**c** |Go to page comments
129 |**a** |Go to page attachments
130 |**h** |Go to page history
131 |**d** |View page wiki code
132
133 ==== Actions ====
134
135 (% style="width:400px;"%)
136 |**F2** |Rename page
137 |**Delete** |Delete page
138
139 === Edit & inline mode ===
140
141 {{warning}}Keyboard shortcuts aren't available from the wysiwyg edit mode (since the wysiwyg editor grabs all the key pressed events){{/warning}}
142 (% style="width:400px;"%)
143 |**<Alt> + c** |Cancel edition
144 |**<Alt> + p** |Preview the page without saving
145 |**<Alt> + <Shift> + s** |Save and continue to edit the page
146 |**<Alt> + s** |Save and view the page
147
148 === Preview mode ===
149
150 (% style="width:400px;"%)
151 |**<Alt> + c** |Cancel edition
152 |**<Alt> + b** |Back to the edition
153 |**<Alt> + <Shift> + s** |Save and continue to edit the page
154 |**<Alt> + s** |Save and view the page
155
156 == Adding your own shortcuts ==
157
158 You can add your own keyboard shortcuts in a few javascript lines :
159
160 {{code language="javascript"}}
161 <script type="text/javascript">
162 //<![CDATA[
163 shortcut.add("Ctrl+Alt+Shift+N", function() { alert("Hey there! Congratulations on typing this one ;)"); });
164 //]]>
165 </script>
166 {{/code}}
167
168 {{html}}
169 <script type="text/javascript">
170 shortcut.add("Ctrl+Alt+Shift+N", function() { alert("Hey there! Congratulations on typing this one ;)"); }, {'propagate':false} );
171 </script>
172 {{/html}}
173
174 Try the snippet by pressing Ctrl+Alt+N.
175
176 [[Complete documentation>>http://www.openjs.com/scripts/events/keyboard_shortcuts/]].
177
178 == Removing shortcuts ==
179
180 To remove a shortcut adapt this snippet to your needs :
181
182 {{code language="javascript"}}
183 <script type="text/javascript">
184 //<![CDATA[
185 for (binding in shortcut.all_shortcuts) {
186 shortcut.remove(binding);
187 }
188 //]]>
189 </script>
190 {{/code}}
191
192 {{velocity}}
193 #if (!$isGuest)
194 {{html}}
195 <script type="text/javascript">
196 funtion removeCtrlAltShiftN() {
197 shortcut.remove("Ctrl+Alt+Shift+N");
198 }
199 </script>
Jean-Vincent Drean 1.1 200 <a onclick="removeCtrlAltShiftN();">Click here to try the snippet, will remove the Ctrl+Alt+Shift+N shortcut</a>.
Jean-Vincent Drean 3.1 201 {{/html}}
202 #end
203 {{velocity}}
Jean-Vincent Drean 1.1 204
Silvia Macovei 2.1 205 == i18n ==
Jean-Vincent Drean 1.1 206
207 All the core XWiki shortcuts can be modified in the xwiki-core application resources (core.shortcuts.*)
208
Silvia Macovei 2.1 209 == Credits ==
Jean-Vincent Drean 1.1 210
Silvia Macovei 2.1 211 XWiki keyboard shortcuts are powered by [[openjs.org shortcut library>>http://www.openjs.com/scripts/events/keyboard_shortcuts/]].

Get Connected