diff options
author | Olivier Hallot <olivier.hallot@libreoffice.org> | 2017-08-02 00:49:11 -0300 |
---|---|---|
committer | Olivier Hallot <olivier.hallot@edx.srv.br> | 2017-08-02 06:01:42 +0200 |
commit | 9f9cebab254146cbae0a093626ed78801e85b98f (patch) | |
tree | 2a6e56904450fe3d88ad2d21e561a5c83d7c9dd8 /help3xsl/index2.html | |
parent | 4d6f86d203814a211eae9dfacd4baf195ca4ff1d (diff) |
tdf#97745 Handle offline browser help
* Rename index.html to LOHelp.html. index.html is a bad name,
too generic. LOHelp.html is invoked by LibreOffice and is not a
popular file name.
* Clean the XSLT transform, add suport for local help.
* reposition bookmark2file.js in the target tree.
* remove obsolete files
* page tree now capable to be opened by file:// protocol, passing
'online' parameter and folder address to the bash script.
Change-Id: I2cf9f69de7896bd74074745993ef033bef5c3503
Reviewed-on: https://gerrit.libreoffice.org/40661
Reviewed-by: Olivier Hallot <olivier.hallot@edx.srv.br>
Tested-by: Olivier Hallot <olivier.hallot@edx.srv.br>
Diffstat (limited to 'help3xsl/index2.html')
-rw-r--r-- | help3xsl/index2.html | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/help3xsl/index2.html b/help3xsl/index2.html new file mode 100644 index 0000000000..fb0cb76a44 --- /dev/null +++ b/help3xsl/index2.html @@ -0,0 +1,52 @@ +<!DOCTYPE html> +<!-- +* This file is part of the LibreOffice project. +* +* This Source Code Form is subject to the terms of the Mozilla Public +* License, v. 2.0. If a copy of the MPL was not distributed with this +* file, You can obtain one at http://mozilla.org/MPL/2.0/. +--> +<html> + <head> + <script type="text/javascript" src="help.js"></script> + <script type="text/javascript" src="bookmark2file.js"></script> + </head> + <body> + <script type="text/javascript"> + var url = window.location.href; + var n = url.indexOf('index.html?'); + if (n != -1){ + // the URL came from LibreOffice help (F1) + var version = getParameterByName("Version",url); + var lang = getParameterByName("Language",url); + var system = getParameterByName("System",url); + var rest= url.substr(n+11,url.lenght); + var module; + var defaultFile; + var smodule = rest.substr(0, rest.indexOf('/')); + switch (smodule) { + case "swriter": {defaultFile='text/swriter/main0000.html';module="WRITER";break;} + case "scalc": {defaultFile='text/scalc/main0000.html';module="CALC";break;} + case "simpress": {defaultFile='text/simpress/main0000.html';module="IMPRESS";break;} + case "sdraw": {defaultFile='text/sdraw/main0000.html';module="DRAW";break;} + case "smath": {defaultFile='text/smath/main0000.html';module="MATH";break;} + case "sdatabase": {defaultFile='text/shared/explorer/database/main.html';module="BASE";break;} + case "sbasic": {defaultFile='text/sbasic/shared/main0601.html';module="BASIC";break;} + default: {defaultFile='text/shared/main0000.html';module="WRITER";break;} + } + var bookmark = rest.slice(rest.indexOf('/')+1, rest.indexOf('?')); + var file = map[bookmark]; + // rebuild URL + if (file=='undefined'){ + file = defaultFile; + } + var newURL = lang+'/'+file+'?System='+system+'&DbPAR='+module; + window.open(newURL,'_self'); + }else{ + // URL came from elsewhere, direct access to webroot, we redirect to main Help page + window.open('en-US/text/shared/main0108.html?&DbPAR=WRITER&System=WIN','_self'); + } + </script> + </body> +</html> + |