index.html 3.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. <!DOCTYPE html>
  2. <!--
  3. * This file is part of the LibreOffice project.
  4. *
  5. * This Source Code Form is subject to the terms of the Mozilla Public
  6. * License, v. 2.0. If a copy of the MPL was not distributed with this
  7. * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  8. -->
  9. <html>
  10. <head>
  11. <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
  12. <meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-inline' 'unsafe-eval' piwik.documentfoundation.org"/>
  13. <script type="text/javascript" src="polyfills.js"></script>
  14. <script type="text/javascript" src="hid2file.js"></script>
  15. <script type="text/javascript" src="languages.js"></script>
  16. <script type="text/javascript" src="help2.js" defer></script>
  17. </head>
  18. <body>
  19. <script type="text/javascript">
  20. // We have to wait until both the deferred help2.js and the document have loaded
  21. window.addEventListener('DOMContentLoaded', function() {
  22. var url = window.location.href;
  23. var n = url.indexOf('index.html?');
  24. if (n != -1) {
  25. // the URL came from LibreOffice help (F1)
  26. var target = getParameterByName("Target",url);
  27. var lang = existingLang(getParameterByName("Language", url));
  28. var system = getParameterByName("System", url);
  29. var module;
  30. var defaultFile;
  31. var smodule = target.substr(0, target.indexOf('/'));
  32. switch (smodule) {
  33. case "swriter": {defaultFile='text/swriter/main0000.html';module="WRITER";break;}
  34. case "scalc": {defaultFile='text/scalc/main0000.html';module="CALC";break;}
  35. case "schart": {defaultFile='text/schart/main0000.html';module="CHART";break;}
  36. case "simpress": {defaultFile='text/simpress/main0000.html';module="IMPRESS";break;}
  37. case "sdraw": {defaultFile='text/sdraw/main0000.html';module="DRAW";break;}
  38. case "smath": {defaultFile='text/smath/main0000.html';module="MATH";break;}
  39. case "sdatabase": {defaultFile='text/sdatabase/main.html';module="BASE";break;}
  40. case "sbasic": {defaultFile='text/sbasic/shared/main0601.html';module="BASIC";break;}
  41. default: {defaultFile='text/shared/05/new_help.html';module="SHARED";break;}
  42. }
  43. //Special case of application F1 or menu Help -> LibreOffice Help
  44. if (target.indexOf('.uno:HelpIndex') != -1) {
  45. window.location.replace(lang + '/' + defaultFile + '?System=' + system + '&DbPAR=' + module);
  46. }
  47. var bookmark = target.slice(target.indexOf('/') + 1, target.length);
  48. var file = hid2fileMap[bookmark];
  49. // check first if a root bookmark @@nowidget@@ can be used
  50. if (file === undefined) {
  51. var b2 = bookmark.substring(0, bookmark.lastIndexOf("/")) + '/@@nowidget@@';
  52. file = hid2fileMap[b2];
  53. }
  54. // rebuild URL
  55. if (file === undefined) {
  56. var newURL = lang + '/text/shared/05/err_html.html?System=' + system + '&DbPAR=' + module + '&HID=' + bookmark ;
  57. } else {
  58. var indx = file.indexOf('#');
  59. var bm = file.substr(indx,file.length);
  60. file = file.substr(0,indx);
  61. var newURL = lang + '/' + file + '?System=' + system + '&DbPAR=' + module + '&HID=' + bookmark + bm;
  62. }
  63. window.location.replace(newURL);
  64. } else {
  65. // URL came from elsewhere, direct access to webroot, we redirect to main Help page
  66. var system = 'WIN';
  67. if (navigator.userAgent.indexOf("Mac") != -1) system = 'MAC';
  68. if (navigator.userAgent.indexOf("Linux") != -1) system = 'UNIX';
  69. window.location.replace(existingLang(navigator.language) + '/text/shared/05/new_help.html?&DbPAR=SHARED&System=' + system);
  70. }
  71. });
  72. </script>
  73. </body>
  74. </html>