Wiki source code of KeyboardShortcuts

Version 5.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.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
Jean-Vincent Drean 1.1 23
Silvia Macovei 2.1 24 ==== Show ====
Jean-Vincent Drean 1.1 25
Silvia Macovei 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
Jean-Vincent Drean 1.1 31
Silvia Macovei 2.1 32 ==== Actions ====
Jean-Vincent Drean 1.1 33
Silvia Macovei 2.3 34 (% style="width:400px;"%)
35 |**F2** |Rename page
36 |**Delete** |Delete page
Jean-Vincent Drean 1.1 37
Silvia Macovei 2.1 38 === Edit & inline mode ===
Jean-Vincent Drean 1.1 39
Silvia Macovei 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}}
Silvia Macovei 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
Jean-Vincent Drean 1.1 46
Silvia Macovei 2.1 47 === Preview mode ===
Jean-Vincent Drean 1.1 48
Silvia Macovei 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
Jean-Vincent Drean 1.1 54
Silvia Macovei 2.1 55 == Adding your own shortcuts ==
Jean-Vincent Drean 1.1 56
57 You can add your own keyboard shortcuts in a few javascript lines :
58
Silvia Macovei 2.1 59 {{code language="javascript"}}
Jean-Vincent Drean 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>
Silvia Macovei 2.1 65 {{/code}}
Jean-Vincent Drean 1.1 66
Jean-Vincent Drean 5.1 67 {{html}}
Jean-Vincent Drean 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>
Jean-Vincent Drean 5.1 71 {{/html}}
72
Jean-Vincent Drean 1.1 73 Try the snippet by pressing Ctrl+Alt+N.
Jean-Vincent Drean 5.1 74
Silvia Macovei 2.1 75 [[Complete documentation>>http://www.openjs.com/scripts/events/keyboard_shortcuts/]].
Jean-Vincent Drean 1.1 76
Silvia Macovei 2.1 77 == Removing shortcuts ==
Jean-Vincent Drean 1.1 78
79 To remove a shortcut adapt this snippet to your needs :
80
Silvia Macovei 2.1 81 {{code language="javascript"}}
Jean-Vincent Drean 1.1 82 <script type="text/javascript">
83 //<![CDATA[
84 shortcut.remove("Ctrl+Alt+Shift+N");
85 //]]>
86 </script>
Silvia Macovei 2.1 87 {{/code}}
Jean-Vincent Drean 1.1 88
Jean-Vincent Drean 5.1 89 {{html}}
Jean-Vincent Drean 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>.
Jean-Vincent Drean 5.1 96 {{/html}}
Jean-Vincent Drean 1.1 97
Jean-Vincent Drean 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
Silvia Macovei 2.1 124 == i18n ==
Jean-Vincent Drean 1.1 125
126 All the core XWiki shortcuts can be modified in the xwiki-core application resources (core.shortcuts.*)
127
Silvia Macovei 2.1 128 == Credits ==
Jean-Vincent Drean 1.1 129
Silvia Macovei 2.1 130 XWiki keyboard shortcuts are powered by [[openjs.org shortcut library>>http://www.openjs.com/scripts/events/keyboard_shortcuts/]].

Get Connected