Wiki source code of XWiki Keyboard Shortcuts

Version 10.2 by Ecaterina Moraru (Valica) 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 = Modifying keyboard shortcuts =
61
62 * Create a new page in your wiki, for example //XWiki.KeyboardShortcuts// and paste the following content inside:
63 {{code}}core.shortcuts.view.edit=e
64 core.shortcuts.view.wiki=k
65 core.shortcuts.view.wysiwyg=g
66 core.shortcuts.view.inline=f
67 core.shortcuts.view.rights=r
68 core.shortcuts.view.objects=o
69 core.shortcuts.view.class=s
70 core.shortcuts.view.comments=c
71 core.shortcuts.view.attachments=a
72 core.shortcuts.view.history=h
73 core.shortcuts.view.information=i
74 core.shortcuts.view.code=d
75 core.shortcuts.view.delete=Delete
76 core.shortcuts.view.rename=F2
77 core.shortcuts.edit.cancel=Alt+C
78 core.shortcuts.edit.backtoedit=Alt+B
79 core.shortcuts.edit.preview=Alt+P
80 core.shortcuts.edit.saveandcontinue=Alt+Shift+S
81 core.shortcuts.edit.saveandview=Alt+S{{/code}}
82 * Modify entries in this list at your convenience
83 * Save the page
84 * Go to the wiki administration into the "//Programming//" category
85 * At the bottom, add //XWiki.KeyboardShortcuts// to the "//Internationalization Document Bundles//" list
86
87 = Adding your own shortcuts =
88
89 You can add your own keyboard shortcuts in a few javascript lines :
90
91 {{code language="html"}}
92 <script type="text/javascript">
93 //<![CDATA[
94 shortcut.add("Ctrl+Alt+n", function() { alert("Hey there! Congratulations on typing this one ;)"); });
95 //]]>
96 </script>
97 {{/code}}
98
99 {{html clean="false"}}
100 <script type="text/javascript">
101 shortcut.add("Ctrl+Alt+n", function() { alert("Hey there! Congratulations on typing this one ;)"); }, {'propagate':false} );
102 </script>
103 {{/html}}
104
105 Try the snippet by pressing Ctrl+Alt+n.
106
107 [[Complete documentation>>http://www.openjs.com/scripts/events/keyboard_shortcuts/]].
108
109 = Removing shortcuts =
110
111 To remove a shortcut adapt this snippet to your needs :
112
113 {{code language="html"}}
114 <script type="text/javascript">
115 //<![CDATA[
116 shortcut.remove("Ctrl+Alt+n");
117 //]]>
118 </script>
119 {{/code}}
120
121 {{html clean="false"}}
122 <script type="text/javascript">
123 function removeCtrlAltN() {
124 shortcut.remove("Ctrl+Alt+n");
125 }
126 </script>
127 <a onclick="removeCtrlAltN(); return false;" href="#">Click here to try the snippet, it will remove the Ctrl+Alt+n shortcut</a>.
128 {{/html}}
129
130 = Removing all shortcuts at once =
131
132 {{code language="html"}}
133 <script type="text/javascript">
134 //<![CDATA[
135 for (binding in shortcut.all_shortcuts) {
136 shortcut.remove(binding);
137 }
138 //]]>
139 </script>
140 {{/code}}
141
142 {{velocity}}
143 #if (!$isGuest && $isAdvancedUser)
144 {{html clean="false"}}
145 <script type="text/javascript">
146 //<![CDATA[
147 function removeAll() {
148 for (binding in shortcut.all_shortcuts) {
149 shortcut.remove(binding);
150 }
151 }
152 //]]>
153 </script>
154 <a onclick="removeAll(); return false;" href="#">Click here to try the snippet, it will disable all keyboard shortcuts</a>.
155 {{/html}}
156 #end
157 {{/velocity}}
158
159 = Credits =
160
161 XWiki keyboard shortcuts are powered by [[openjs.org shortcut library>>http://www.openjs.com/scripts/events/keyboard_shortcuts]].

Get Connected