Help system improvements (II)

Jan Holesovsky kendy at collabora.com
Thu Jun 1 09:13:22 UTC 2017


Hi Olivier,

Olivier Hallot píše v Út 30. 05. 2017 v 14:02 -0300:

> The issue is to dynamically load the bookmark_<module>.html file in the
> page. Currently the JS solution is
> 
>     $("#BottomLeft").load('bookmark_'+module+'.html');
> 
> (I tested replacing it by <iframe> or <object> but that brings other
> issues. I also tested < link rel="imports" bookmark.../> but I also hit
> restrictions on browsers (http://caniuse.com/#feat=imports) )

Ah yeah; but we generate the bookmark files ourselves; so the
Tafkadasoh's solution from

https://stackoverflow.com/questions/8988855/include-another-html-file-in-a-html-file

is perfectly usable for us:

a.html:

<html> 
  <body>
  <h1>Put here your HTML content before insertion of b.js.</h1>
      ...

  <script src="b.js"></script>

      ...

  <p>And here whatever content you want afterwards.</p>
  </body>
</html>

b.js:

document.write('\
\
    <h1>Add your HTML code here</h1>\
\
     <p>Notice however, that you have to escape LF's with a '\', just like\
        demonstrated in this code listing.\
    </p>\
\
');

:-)

[And we even can even have a 'smarter' b.js - list of links + tests, and
generate the resulting html in the JS.]

All the best,
Kendy



More information about the LibreOffice mailing list