| 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 |
// tdf#156573 Replace character "?" by "%3F" |
| 49 |
bookmark = bookmark.replace("?", "%3F"); |
| 50 |
var file = hid2fileMap[bookmark]; |
| 51 |
// check first if a root bookmark @@nowidget@@ can be used |
| 52 |
if (file === undefined) { |
| 53 |
var b2 = bookmark.substring(0, bookmark.lastIndexOf("/")) + '/@@nowidget@@'; |
| 54 |
file = hid2fileMap[b2]; |
| 55 |
} |
| 56 |
// rebuild URL |
| 57 |
if (file === undefined) { |
| 58 |
var newURL = lang + '/text/shared/05/err_html.html?System=' + system + '&DbPAR=' + module + '&HID=' + bookmark ; |
| 59 |
} else { |
| 60 |
var indx = file.indexOf('#'); |
| 61 |
var bm = file.substr(indx,file.length); |
| 62 |
file = file.substr(0,indx); |
| 63 |
var newURL = lang + '/' + file + '?System=' + system + '&DbPAR=' + module + '&HID=' + bookmark + bm; |
| 64 |
} |
| 65 |
window.location.replace(newURL); |
| 66 |
} else { |
| 67 |
// URL came from elsewhere, direct access to webroot, we redirect to main Help page |
| 68 |
var system = 'WIN'; |
| 69 |
if (navigator.userAgent.indexOf("Mac") != -1) system = 'MAC'; |
| 70 |
if (navigator.userAgent.indexOf("Linux") != -1) system = 'UNIX'; |
| 71 |
window.location.replace(existingLang(navigator.language) + '/text/shared/05/new_help.html?&DbPAR=SHARED&System=' + system); |
| 72 |
} |
| 73 |
}); |
| 74 |
</script> |
| 75 |
</body> |
| 76 |
</html> |