Wiki source code of KeyboardShortcuts

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

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

Get Connected