0
|
1 /**
|
|
2 * Help plugin client script
|
|
3 * @version 1.4
|
|
4 *
|
|
5 * @licstart The following is the entire license notice for the
|
|
6 * JavaScript code in this file.
|
|
7 *
|
|
8 * Copyright (c) 2012-2014, The Roundcube Dev Team
|
|
9 *
|
|
10 * The JavaScript code in this page is free software: you can redistribute it
|
|
11 * and/or modify it under the terms of the GNU General Public License
|
|
12 * as published by the Free Software Foundation, either version 3 of
|
|
13 * the License, or (at your option) any later version.
|
|
14 *
|
|
15 * @licend The above is the entire license notice
|
|
16 * for the JavaScript code in this file.
|
|
17 */
|
|
18
|
|
19 // hook into switch-task event to open the help window
|
|
20 if (window.rcmail) {
|
|
21 rcmail.addEventListener('beforeswitch-task', function(prop) {
|
|
22 // catch clicks to help task button
|
|
23 if (prop == 'help') {
|
|
24 if (rcmail.task == 'help') // we're already there
|
|
25 return false;
|
|
26
|
|
27 var url = rcmail.url('help/index', { _rel: rcmail.task + (rcmail.env.action ? '/'+rcmail.env.action : '') });
|
|
28 if (rcmail.env.help_open_extwin) {
|
|
29 rcmail.open_window(url, 1020, false);
|
|
30 }
|
|
31 else {
|
|
32 rcmail.redirect(url, false);
|
|
33 }
|
|
34
|
|
35 return false;
|
|
36 }
|
|
37 });
|
|
38 }
|