You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

help.js 1.2KB

1234567891011121314151617181920212223242526272829303132333435363738
  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. // hook into switch-task event to open the help window
  19. if (window.rcmail) {
  20. rcmail.addEventListener('beforeswitch-task', function(prop) {
  21. // catch clicks to help task button
  22. if (prop == 'help') {
  23. if (rcmail.task == 'help') // we're already there
  24. return false;
  25. var url = rcmail.url('help/index', { _rel: rcmail.task + (rcmail.env.action ? '/'+rcmail.env.action : '') });
  26. if (rcmail.env.help_open_extwin) {
  27. rcmail.open_window(url, 1020, false);
  28. }
  29. else {
  30. rcmail.redirect(url, false);
  31. }
  32. return false;
  33. }
  34. });
  35. }