Hide last authors
author | version | line-number | content |
---|---|---|---|
7.2 | 1 | {{box cssClass="floatinginfobox" title="**Contents**"}}{{toc/}}{{/box}} | |
1.1 | 2 | ||
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. | |
1.1 | 4 | ||
7.2 | 5 | = Shortcuts = | |
1.1 | 6 | ||
7.2 | 7 | == View mode == | |
1.1 | 8 | ||
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}} | |
1.1 | 10 | ||
7.2 | 11 | === Edit === | |
1.1 | 12 | ||
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 | ||
1.1 | 21 | ||
7.2 | 22 | === Show === | |
1.1 | 23 | ||
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 | ||
1.1 | 29 | ||
7.2 | 30 | === Actions === | |
1.1 | 31 | ||
2.3 | 32 | (% style="width:400px;"%) | |
33 | |**F2** |Rename page | ||
34 | |**Delete** |Delete page | ||
1.1 | 35 | ||
7.2 | 36 | == Edit & inline mode == | |
1.1 | 37 | ||
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}} | |
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 | ||
1.1 | 44 | ||
7.2 | 45 | == Preview mode == | |
1.1 | 46 | ||
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 | ||
1.1 | 52 | ||
7.2 | 53 | = Modifying keyboard shortcuts = | |
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 | |||
7.2 | 82 | = Adding your own shortcuts = | |
1.1 | 83 | ||
84 | You can add your own keyboard shortcuts in a few javascript lines : | ||
85 | |||
2.1 | 86 | {{code language="javascript"}} | |
1.1 | 87 | <script type="text/javascript"> | |
88 | //<![CDATA[ | ||
6.2 | 89 | shortcut.add("Ctrl+Alt+n", function() { alert("Hey there! Congratulations on typing this one ;)"); }); | |
1.1 | 90 | //]]> | |
91 | </script> | ||
2.1 | 92 | {{/code}} | |
1.1 | 93 | ||
6.1 | 94 | {{html clean="false"}} | |
1.1 | 95 | <script type="text/javascript"> | |
6.2 | 96 | shortcut.add("Ctrl+Alt+n", function() { alert("Hey there! Congratulations on typing this one ;)"); }, {'propagate':false} ); | |
1.1 | 97 | </script> | |
5.1 | 98 | {{/html}} | |
99 | |||
6.2 | 100 | Try the snippet by pressing Ctrl+Alt+n. | |
5.1 | 101 | ||
2.1 | 102 | [[Complete documentation>>http://www.openjs.com/scripts/events/keyboard_shortcuts/]]. | |
1.1 | 103 | ||
7.2 | 104 | = Removing shortcuts = | |
1.1 | 105 | ||
106 | To remove a shortcut adapt this snippet to your needs : | ||
107 | |||
2.1 | 108 | {{code language="javascript"}} | |
1.1 | 109 | <script type="text/javascript"> | |
110 | //<![CDATA[ | ||
6.2 | 111 | shortcut.remove("Ctrl+Alt+n"); | |
1.1 | 112 | //]]> | |
113 | </script> | ||
2.1 | 114 | {{/code}} | |
1.1 | 115 | ||
6.1 | 116 | {{html clean="false"}} | |
1.1 | 117 | <script type="text/javascript"> | |
6.4 | 118 | function removeCtrlAltN() { | |
6.2 | 119 | shortcut.remove("Ctrl+Alt+n"); | |
1.1 | 120 | } | |
121 | </script> | ||
6.6 | 122 | <a onclick="removeCtrlAltN(); return false;" href="#">Click here to try the snippet, it will remove the Ctrl+Alt+n shortcut</a>. | |
5.1 | 123 | {{/html}} | |
1.1 | 124 | ||
7.2 | 125 | = Removing all shortcuts at once = | |
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}} | ||
6.5 | 138 | #if (!$isGuest && $isAdvancedUser) | |
6.1 | 139 | {{html clean="false"}} | |
5.1 | 140 | <script type="text/javascript"> | |
141 | //<![CDATA[ | ||
6.6 | 142 | function removeAll() { | |
5.1 | 143 | for (binding in shortcut.all_shortcuts) { | |
144 | shortcut.remove(binding); | ||
145 | } | ||
6.6 | 146 | } | |
5.1 | 147 | //]]> | |
148 | </script> | ||
6.6 | 149 | <a onclick="removeAll(); return false;" href="#">Click here to try the snippet, it will disable all keyboard shortcuts</a>. | |
5.1 | 150 | {{/html}} | |
151 | #end | ||
152 | {{velocity}} | ||
153 | |||
7.2 | 154 | = Credits = | |
1.1 | 155 | ||
2.1 | 156 | XWiki keyboard shortcuts are powered by [[openjs.org shortcut library>>http://www.openjs.com/scripts/events/keyboard_shortcuts/]]. |