-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdefault.inc.php
More file actions
422 lines (348 loc) · 12.4 KB
/
default.inc.php
File metadata and controls
422 lines (348 loc) · 12.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
<?php
// Plugin default configuration file.
// Override these entries in the global config file.
// Users can change exposed entries form the application settings ui.
$config = array();
// activate plugin features
$config['plugin.hotkeys.activate_plugin'] = true;
// plugin loggin for debug
$config['plugin.hotkeys.enable_logging'] = false;
// plugin activation toolbar button
$config['plugin.hotkeys.enable_button'] = true;
// prevent default browser keys
$config['plugin.hotkeys.enable_prevent'] = true;
// remove invalid mapping entries
$config['plugin.hotkeys.enable_mapping_cleanup'] = true;
// global plugin dialog access shortcut
$config['plugin.hotkeys.plugin_hotkey'] = 'f1'; // lower case
// global plugin icon, choose from assets/fontello
$config['plugin.hotkeys.plugin_icon_class'] = 'hotkeys-icon-keyboard-black';
// process file import on the client
$config['plugin.hotkeys.import_local'] = true;
// file export naming: 'prefix-profile.extension'
$config['plugin.hotkeys.export_prefix'] = 'hotkeys';
$config['plugin.hotkeys.export_extension'] = 'json';
// enabled client ui behaviour
$config['plugin.hotkeys.feature_choice'] = array(
// 'change_event_order',
'command_auto_enable',
'queue_busy_keys',
// 'show_arkon_tooltips',
'show_changer_tooltips',
);
// available select/options
$config['plugin.hotkeys.feature_choice.list'] = array(
'change_event_order', // place plugin key handlers first FIXME
'command_auto_enable', // manage command enabelment around invocation
'queue_busy_keys', // process keys when core rcmail app is not busy
// 'show_arkon_tooltips', // TODO
'show_changer_tooltips', // display tooltips in the mapping editor dialog
);
// tooltip animation delay
$config['plugin.hotkeys.feature_tooltip_delay'] = 1500; // millis
// persisted command/hotkey mapping table
$config['plugin.hotkeys.mapping_list'] = array();
// memento of one time default mapping application
$config['plugin.hotkeys.reset_to_default'] = true;
// provided one time init command/hotkey mapping table - from file
$config['plugin.hotkeys.default_mapping_file'] = 'hotkeys.json';
// provided one time init command/hotkey mapping table - form here
$config['plugin.hotkeys.default_mapping_list'] = array(
array( // TODO remove empty template
'profile' => '',
'context' => '',
'command' => '',
'comment' => '',
'script' => '',
'key' => '',
),
array( // TODO remove test entry
'profile' => 'user',
'context' => 'any',
'command' => 'test',
'comment' => 'test entry 1',
'script' => 'alert("test 1");',
'key' => 'ctrl+alt+1',
),
array( // TODO remove test entry
'profile' => 'user',
'context' => 'any',
'command' => 'test',
'comment' => 'test entry 2',
'script' => 'alert("test 2");',
'key' => 'ctrl+alt+2',
),
array( // TODO remove example
'profile' => 'user',
'context' => 'any',
'command' => 'reload',
'comment' => 'reload client from the server',
'script' => 'document.location.reload(true);',
'key' => 'alt+f1',
),
);
// currently active mapping category
$config['plugin.hotkeys.profile'] = 'cor.bosman';
// enabled command/hotkey mapping categories
$config['plugin.hotkeys.profile_list'] = array(
'user',
'linux',
'macosx',
'windows',
'cor.bosman', // TODO remove example
'andrei.pozolotin', // TODO remove example
);
// command/hotkey mapping filter
// empty/missing array() in filter matches any
$config['plugin.hotkeys.context_mapa'] = array(
'any' => array(
'help' => 'catch-all context',
'task_list' => array(), // required tasks in rcmail.env.task
'action_list' => array(), // required actions in rcmail.env.action
'focused_mapa' => array(), // node id => present/missing in window.focus
'target_name_mapa' => array(), // node name rx => present/missing in event.target
),
'mail_any' => array(
'help' => 'global mail access',
'task_list' => array('mail', ),
) ,
'mail_box' => array(
'help' => 'visible mailbox list',
'task_list' => array('mail', ),
'action_list' => array('', 'list', 'show', 'preview', ),
) ,
'mail_list' => array(
'help' => 'visible message list',
'task_list' => array('mail', ),
'action_list' => array('', 'list', ),
'target_name_mapa' => array( 'input|select' => false, ),
) ,
'mail_edit' => array(
'help' => 'mail compose editor',
'task_list' => array('mail', ),
'action_list' => array('compose', ),
),
'mail_view' => array(
'help' => 'visible mail body frame (no edit)',
'task_list' => array('mail', ),
'action_list' => array('show', 'preview', ),
),
'book_any' => array(
'help' => 'global address book access',
'task_list' => array('addressbook', ),
'action_list' => array(),
),
'book_list' => array( // visible contact list
'help' => '',
'task_list' => array('addressbook', ),
'action_list' => array(''),
),
'book_edit' => array(
'help' => '',
'task_list' => array('addressbook', ),
'action_list' => array('edit'),
),
'book_view' => array(
'help' => '',
'task_list' => array('addressbook', ),
'action_list' => array('show', ),
),
'mailboxlist' => array( // mail folder list
'help' => '',
'focused_mapa' => array('mailboxlist' => true),
) ,
'quicksearchbox' => array(
'help' => 'shared mail & book search',
'focused_mapa' => array('quicksearchbox' => true),
) ,
'messagessearchfilter' => array(
'help' => 'mail filter selector',
'focused_mapa' => array('messagessearchfilter' => true),
) ,
'contacts-table' => array(
'help' => 'address book contact list',
'focused_mapa' => array('contacts-table' => true),
) ,
);
// https://github.com/jeresig/jquery.hotkeys
// control jQuery.hotkeys.options.filterTextInputs
// control jQuery.hotkeys.options.filterInputAcceptingElements
$config['plugin.hotkeys.options_filter_input'] = false;
// user managed commands
$config['plugin.hotkeys.custom_command_list'] = array(
'#', // a place for 'new'
'noop', // idle command
'test', // command testing
// mail list
'reload', // reload page in browser
'select:all', // global list selection
'select:page', // limited page selection
'#mailboxlist', // focus/blur mailbox list table
'#messagelist', // focus/blur message list table
'#quicksearchbox', // focus/blur type-in search input
'#messagessearchfilter', // focus/blur message list filter
// mail compose
'edit:html', // switch editor to html
'edit:text', // switch editor to text
'#contactsearchbox', // focus/blur contact finder
'#_from', // focus/blur "from" input
'#_to', // focus/blur "to" input
'#compose-subject', // focus/blur "subject" input
'#composebody', // edit area, text mode
'#composebody_ifr', // edit area, html mode
// address book
'#contacts-table', // focus/blur book contact list
'#contacttabs:1', // switch to contact form tab
'#contacttabs:2', // switch to contact form tab
'#contacttabs:3', // switch to contact form tab
);
// known built-ins: see program/js/app.js rcube_webmail.command()
$config['plugin.hotkeys.internal_command_list'] = array(
'login',
'logout',
'mail',
'addressbook',
'settings',
'about',
'permaurl',
'extwin',
'change-format',
'menu-open',
'menu-close',
'menu-save',
'open',
'close',
'list',
'set-listmode',
'sort',
'nextpage',
'lastpage',
'previouspage',
'firstpage',
'expunge',
'purge',
'show',
'add',
'edit',
'save',
'delete',
'move',
'copy',
'mark',
'toggle_flag',
'always-load',
'load-images',
'download-attachment',
'select-all',
'select-none',
'expand-all',
'expand-unread',
'collapse-all',
'nextmessage',
'lastmessage',
'previousmessage',
'firstmessage',
'compose',
'spellcheck',
'savedraft',
'send',
'send-attachment',
'insert-sig',
'list-addresses',
'add-recipient',
'reply-all',
'reply-list',
'reply',
'forward-attachment',
'forward-inline',
'forward',
'print',
'viewsource',
'download',
'search',
'reset-search',
'pushgroup',
'listgroup',
'popgroup',
'import-messages',
'import',
'export',
'export-selected',
'upload-photo',
'delete-photo',
'preferences',
'identities',
'responses',
'folders',
'undo',
'checkmail',
);
///////
// expose these settings in user ui
$config['plugin.hotkeys.settings_checkbox_list'] = array(
'activate_plugin',
'enable_logging',
'enable_button',
'enable_prevent',
// 'options_filter_input',
'reset_to_default',
);
// expose these settings in user ui
$config['plugin.hotkeys.settings_select_list'] = array(
'feature_choice',
);
// expose these settings in user ui
$config['plugin.hotkeys.settings_area_list'] = array(
'profile_list',
'custom_command_list',
// 'internal_command_list',
'supported_meta_keys',
// 'supported_base_keys',
'prevent_default_keys',
);
// expose these settings in user ui
$config['plugin.hotkeys.settings_text_list'] = array(
'plugin_hotkey',
// 'plugin_icon_class',
// 'feature_tooltip_delay',
);
///////////
// can not use some keys:
// reserved by chromium: [Shift]Ctrl(Q|N|W|T|↹|{number}),
// https://support.google.com/chrome/answer/157179?hl=en
// reserved by firefox: TODO
// reserved by int exp: TODO
// TODO make browser/os dependent
// disable these default browser actions
$config['plugin.hotkeys.prevent_default_keys'] = array(
'f1', 'f2', 'f3', 'f4', 'f5', 'f6', 'f7', 'f8', 'f9', 'f10',
'alt+1', 'alt+2', 'alt+3', 'alt+4', 'alt+5', 'alt+6', 'alt+7', 'alt+8', 'alt+9', 'alt+0',
'ctrl+h', // history
'ctrl+d', // bookmark
'ctrl+e', // location
'ctrl+k', // location
'ctrl+l', // location
'ctrl+g', // location
'ctrl+j', // download
'ctrl+f', // search
'ctrl+p', // print
'ctrl+s', // save
'ctrl+r', // reload
'ctrl+u', // view html
'ctrl+o', // open file
);
// permitted alt/ctrl/shift prefix key combinations
$config['plugin.hotkeys.supported_meta_keys'] = array( // lower case
'alt', 'ctrl', 'shift', 'alt+ctrl', 'alt+shift', 'ctrl+shift',
);
// permitted base keys, to use as-is and to combine with meta_keys
$config['plugin.hotkeys.supported_base_keys'] = array( // lower case
'esc', 'tab', 'space', 'return', 'backspace', 'scroll', 'capslock', 'numlock',
'insert', 'home', 'del', 'end', 'pageup', 'pagedown', 'left', 'up', 'right', 'down',
'f1', 'f2', 'f3', 'f4', 'f5', 'f6', 'f7', 'f8', 'f9', 'f10', 'f11', 'f12',
'1', '2', '3', '4', '5', '6', '7', '8', '9', '0',
'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j',
'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's',
't', 'u', 'v', 'w', 'x', 'y', 'z',
);
?>