Wiki source code of XWiki Keyboard Shortcuts

Version 8.1 by Thomas Mortagne on 2010/06/12

Hide last authors
Thomas Mortagne 8.1 1 {{box cssClass="floatinginfobox" title="**Contents**"}}
2 {{toc/}}
3 {{/box}}
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 7.2 7 = Shortcuts =
Jean-Vincent Drean 1.1 8
Silvia Macovei 7.2 9 == View mode ==
Jean-Vincent Drean 1.1 10
Thomas Mortagne 8.1 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}}
Jean-Vincent Drean 1.1 14
Silvia Macovei 7.2 15 === Edit ===
Jean-Vincent Drean 1.1 16
Thomas Mortagne 8.1 17 (% style="width:400px;" %)
Silvia Macovei 2.3 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
Jean-Vincent Drean 1.1 25
Thomas Mortagne 8.1 26 === Show ===
Jean-Vincent Drean 1.1 27
Thomas Mortagne 8.1 28 (% style="width:400px;" %)
Silvia Macovei 2.3 29 |**c** |Go to page comments
30 |**a** |Go to page attachments
31 |**h** |Go to page history
32 |**d** |View page wiki code
Jean-Vincent Drean 1.1 33
Silvia Macovei 7.2 34 === Actions ===
Jean-Vincent Drean 1.1 35
Thomas Mortagne 8.1 36 (% style="width:400px;" %)
Silvia Macovei 2.3 37 |**F2** |Rename page
38 |**Delete** |Delete page
Jean-Vincent Drean 1.1 39
Silvia Macovei 7.2 40 == Edit & inline mode ==
Jean-Vincent Drean 1.1 41
Thomas Mortagne 8.1 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;" %)
Silvia Macovei 2.3 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
Jean-Vincent Drean 1.1 51
Silvia Macovei 7.2 52 == Preview mode ==
Jean-Vincent Drean 1.1 53
Thomas Mortagne 8.1 54 (% style="width:400px;" %)
Silvia Macovei 2.3 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
Jean-Vincent Drean 1.1 59
Silvia Macovei 7.2 60 = Modifying keyboard shortcuts =
Jean-Vincent Drean 7.1 61
62 * Create a new page in your wiki, for example //XWiki.KeyboardShortcuts// and paste the following content inside:
Thomas Mortagne 8.1 63 {{code}}core.shortcuts.view.edit=e
Jean-Vincent Drean 7.1 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
Thomas Mortagne 8.1 81 core.shortcuts.edit.saveandview=Alt+S{{/code}}
Jean-Vincent Drean 7.1 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
Silvia Macovei 7.2 87 = Adding your own shortcuts =
Jean-Vincent Drean 1.1 88
89 You can add your own keyboard shortcuts in a few javascript lines :
90
Thomas Mortagne 8.1 91 {{code language="html"}}
Jean-Vincent Drean 1.1 92 <script type="text/javascript">
93 //<![CDATA[
Jean-Vincent Drean 6.2 94 shortcut.add("Ctrl+Alt+n", function() { alert("Hey there! Congratulations on typing this one ;)"); });
Jean-Vincent Drean 1.1 95 //]]>
96 </script>
Silvia Macovei 2.1 97 {{/code}}
Jean-Vincent Drean 1.1 98
Jean-Vincent Drean 6.1 99 {{html clean="false"}}
Jean-Vincent Drean 1.1 100 <script type="text/javascript">
Jean-Vincent Drean 6.2 101 shortcut.add("Ctrl+Alt+n", function() { alert("Hey there! Congratulations on typing this one ;)"); }, {'propagate':false} );
Jean-Vincent Drean 1.1 102 </script>
Jean-Vincent Drean 5.1 103 {{/html}}
104
Jean-Vincent Drean 6.2 105 Try the snippet by pressing Ctrl+Alt+n.
Jean-Vincent Drean 5.1 106
Silvia Macovei 2.1 107 [[Complete documentation>>http://www.openjs.com/scripts/events/keyboard_shortcuts/]].
Jean-Vincent Drean 1.1 108
Silvia Macovei 7.2 109 = Removing shortcuts =
Jean-Vincent Drean 1.1 110
111 To remove a shortcut adapt this snippet to your needs :
112
Silvia Macovei 2.1 113 {{code language="javascript"}}
Jean-Vincent Drean 1.1 114 <script type="text/javascript">
115 //<![CDATA[
Jean-Vincent Drean 6.2 116 shortcut.remove("Ctrl+Alt+n");
Jean-Vincent Drean 1.1 117 //]]>
118 </script>
Silvia Macovei 2.1 119 {{/code}}
Jean-Vincent Drean 1.1 120
Jean-Vincent Drean 6.1 121 {{html clean="false"}}
Jean-Vincent Drean 1.1 122 <script type="text/javascript">
Jean-Vincent Drean 6.4 123 function removeCtrlAltN() {
Jean-Vincent Drean 6.2 124 shortcut.remove("Ctrl+Alt+n");
Jean-Vincent Drean 1.1 125 }
126 </script>
Jean-Vincent Drean 6.6 127 <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 128 {{/html}}
Jean-Vincent Drean 1.1 129
Silvia Macovei 7.2 130 = Removing all shortcuts at once =
Jean-Vincent Drean 5.1 131
132 {{code language="javascript"}}
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}}
Jean-Vincent Drean 6.5 143 #if (!$isGuest && $isAdvancedUser)
Jean-Vincent Drean 6.1 144 {{html clean="false"}}
Jean-Vincent Drean 5.1 145 <script type="text/javascript">
146 //<![CDATA[
Jean-Vincent Drean 6.6 147 function removeAll() {
Jean-Vincent Drean 5.1 148 for (binding in shortcut.all_shortcuts) {
149 shortcut.remove(binding);
150 }
Jean-Vincent Drean 6.6 151 }
Jean-Vincent Drean 5.1 152 //]]>
153 </script>
Jean-Vincent Drean 6.6 154 <a onclick="removeAll(); return false;" href="#">Click here to try the snippet, it will disable all keyboard shortcuts</a>.
Jean-Vincent Drean 5.1 155 {{/html}}
156 #end
Silvia Macovei 7.3 157 {{/velocity}}
Jean-Vincent Drean 5.1 158
Silvia Macovei 7.2 159 = Credits =
Jean-Vincent Drean 1.1 160
Silvia Macovei 7.3 161 XWiki keyboard shortcuts are powered by [[openjs.org shortcut library>>http://www.openjs.com/scripts/events/keyboard_shortcuts]].

Get Connected