Wiki source code of XWiki Keyboard Shortcuts

Version 11.2 by Eduard Moraru on 2010/07/14

Show last authors
1 {{box cssClass="floatinginfobox" title="**Contents**"}}
2 {{toc/}}
3 {{/box}}
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}}
12 View keyboard shortcuts are only available to advanced users, preventing simple users to get unexpected behavior when pressing keyboard keys by mistake
13 {{/info}}
14
15 === Edit ===
16
17 (% style="width:400px;" %)
18 |**e** |Edit the page using the default edition mode
19 |**k** |Edit the page in wiki edition mode
20 |**g** |Edit the page using the WYSIWYG editor
21 |**f** |Inline Form
22 |**r** |Edit page access rights
23 |**o** |Edit page objects
24 |**s** |Edit class
25
26 === Show ===
27
28 (% style="width:400px;" %)
29 |**c** |Go to page comments
30 |**a** |Go to page attachments
31 |**h** |Go to page history
32 |**d** |View page wiki code
33
34 === Actions ===
35
36 (% style="width:400px;" %)
37 |**F2** |Rename page
38 |**Delete** |Delete page
39
40 == Edit & inline mode ==
41
42 {{warning}}
43 Keyboard shortcuts aren't available from the wysiwyg edit mode (since the wysiwyg editor grabs all the key pressed events)
44 {{/warning}}
45
46 (% style="width:400px;" %)
47 |**<Alt> + c** |Cancel edition
48 |**<Alt> + p** |Preview the page without saving
49 |**<Alt> + <Shift> + s** |Save and continue to edit the page
50 |**<Alt> + s** |Save and view the page
51
52 == Preview mode ==
53
54 (% style="width:400px;" %)
55 |**<Alt> + c** |Cancel edition
56 |**<Alt> + b** |Back to the edition
57 |**<Alt> + <Shift> + s** |Save and continue to edit the page
58 |**<Alt> + s** |Save and view the page
59
60 == Annotations ==
61
62 (% style="width:400px;" %)
63 |**<Ctrl> + m** |Annotate a piece of text
64
65 = Modifying keyboard shortcuts =
66
67 * Create a new page in your wiki, for example //XWiki.KeyboardShortcuts// and paste the following content inside:
68 {{code}}core.shortcuts.view.edit=e
69 core.shortcuts.view.wiki=k
70 core.shortcuts.view.wysiwyg=g
71 core.shortcuts.view.inline=f
72 core.shortcuts.view.rights=r
73 core.shortcuts.view.objects=o
74 core.shortcuts.view.class=s
75 core.shortcuts.view.comments=c
76 core.shortcuts.view.attachments=a
77 core.shortcuts.view.history=h
78 core.shortcuts.view.information=i
79 core.shortcuts.view.code=d
80 core.shortcuts.view.delete=Delete
81 core.shortcuts.view.rename=F2
82 core.shortcuts.edit.cancel=Alt+C
83 core.shortcuts.edit.backtoedit=Alt+B
84 core.shortcuts.edit.preview=Alt+P
85 core.shortcuts.edit.saveandcontinue=Alt+Shift+S
86 core.shortcuts.edit.saveandview=Alt+S{{/code}}
87 * Modify entries in this list at your convenience
88 * Save the page
89 * Go to the wiki administration into the "//Programming//" category
90 * At the bottom, add //XWiki.KeyboardShortcuts// to the "//Internationalization Document Bundles//" list
91
92 = Adding your own shortcuts =
93
94 You can add your own keyboard shortcuts in a few javascript lines :
95
96 {{code language="html"}}
97 <script type="text/javascript">
98 //<![CDATA[
99 shortcut.add("Ctrl+Alt+n", function() { alert("Hey there! Congratulations on typing this one ;)"); });
100 //]]>
101 </script>
102 {{/code}}
103
104 {{html clean="false"}}
105 <script type="text/javascript">
106 shortcut.add("Ctrl+Alt+n", function() { alert("Hey there! Congratulations on typing this one ;)"); }, {'propagate':false} );
107 </script>
108 {{/html}}
109
110 Try the snippet by pressing Ctrl+Alt+n.
111
112 [[Complete documentation>>http://www.openjs.com/scripts/events/keyboard_shortcuts/]].
113
114 = Removing shortcuts =
115
116 To remove a shortcut adapt this snippet to your needs :
117
118 {{code language="html"}}
119 <script type="text/javascript">
120 //<![CDATA[
121 shortcut.remove("Ctrl+Alt+n");
122 //]]>
123 </script>
124 {{/code}}
125
126 {{html clean="false"}}
127 <script type="text/javascript">
128 function removeCtrlAltN() {
129 shortcut.remove("Ctrl+Alt+n");
130 }
131 </script>
132 <a onclick="removeCtrlAltN(); return false;" href="#">Click here to try the snippet, it will remove the Ctrl+Alt+n shortcut</a>.
133 {{/html}}
134
135 = Removing all shortcuts at once =
136
137 {{code language="html"}}
138 <script type="text/javascript">
139 //<![CDATA[
140 for (binding in shortcut.all_shortcuts) {
141 shortcut.remove(binding);
142 }
143 //]]>
144 </script>
145 {{/code}}
146
147 {{velocity}}
148 #if (!$isGuest && $isAdvancedUser)
149 {{html clean="false"}}
150 <script type="text/javascript">
151 //<![CDATA[
152 function removeAll() {
153 for (binding in shortcut.all_shortcuts) {
154 shortcut.remove(binding);
155 }
156 }
157 //]]>
158 </script>
159 <a onclick="removeAll(); return false;" href="#">Click here to try the snippet, it will disable all keyboard shortcuts</a>.
160 {{/html}}
161 #end
162 {{/velocity}}
163
164 = Credits =
165
166 XWiki keyboard shortcuts are powered by [[openjs.org shortcut library>>http://www.openjs.com/scripts/events/keyboard_shortcuts]].

Get Connected