Wiki source code of XWiki Keyboard Shortcuts

Version 7.2 by Silvia Macovei on 2010/02/24

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

Get Connected