Document processHTML
[tolino-api-docs.git] / api / javascript.rst
1 ==============
2 Javascript API
3 ==============
4
5 Non-browser web views have a special JavaScript API that provides
6 integration with Tolino UI elements.
7
8 Example is the ShopWebViewActivity that is opens when clicking the
9 "To the shop" link and the recommendations/advertisements on the main page.
10
11
12 ``android_init()``
13 ==================
14 When the page has been loaded in the web view,
15 a function ``android_init`` is invoked.
16 This can be used to detect if the page has been loaded on a Tolino.
17
18
19 ``screenController``
20 ====================
21 Each web view has a JavaScript variable ``screenController``
22 that provides the interface to the Tolino UI.
23
24
25 ``screenController.hideNavigationHeader()``
26   Hides the header when it was enabled with ``showNavigationHeader``.
27
28 ``screenController.hideProgressDialog()``
29   FIXME
30
31 ``screenController.refreshScreen()``
32   Re-draw the e-ink screen
33
34 ``screenController.setNavigationHeaderTitle("my header")``
35   Override the title in the navigation header.
36   Call ``showNavigationHeader`` first.
37
38 ``screenController.setNavigationHeaderUrl("epublishing://closeshop")``
39   Set the URL of the "back" arrow button.
40
41 ``screenController.setTokens("accesstoken", "refreshtoken")``
42   FIXME
43
44 ``screenController.showNavigationHeader("header title")``
45   Show the native navigation header and set its title
46
47 ``screenController.showProgressDialog()``
48   FIXME
49
50 ``screenController.processHTML("<html>")``
51   Firmware 15.2: Does nothing
52
53   Firmware 15.4.0, Vision 6/Epos 3: Logs the HTML content to the application log.