Difference between revisions of "Javascript API"
Automactic (talk | contribs) (Created page with "# Overview Zim files can be seem as a subset and a snapshot of a website. Webpages in the zim file could have totally different structure and layout. The problem arises whe...") |
Automactic (talk | contribs) (formatting) |
||
Line 1: | Line 1: | ||
== Overview == | |||
Zim files can be seem as a subset and a snapshot of a website. Webpages in the zim file could have totally different structure and layout. | Zim files can be seem as a subset and a snapshot of a website. Webpages in the zim file could have totally different structure and layout. | ||
Line 7: | Line 6: | ||
Some kind of indication should be provided to allow zim readers to turn interactions on or off once a page is loaded. Further, implementations to perform those interactions needs to be included in the zim file itself. | Some kind of indication should be provided to allow zim readers to turn interactions on or off once a page is loaded. Further, implementations to perform those interactions needs to be included in the zim file itself. | ||
== Motivation == | |||
A basic function of zim readers is to provide a table of content of an article. But it is impossible come up with one javascript function to extract table of content in all sorts of zim files. It would make sense for each webpage to come with its own `getTableOfContent()` and `scrollToSection()` function. Some webpages, such as phet or main page, it might make little sense to provide table of content. A way to check `hasTableOfContent` could also be provided. | A basic function of zim readers is to provide a table of content of an article. But it is impossible come up with one javascript function to extract table of content in all sorts of zim files. It would make sense for each webpage to come with its own `getTableOfContent()` and `scrollToSection()` function. Some webpages, such as phet or main page, it might make little sense to provide table of content. A way to check `hasTableOfContent` could also be provided. | ||
== Proposed Solution == | |||
Add javascript with indication and implementation of capabilities to each offliner and load the javascript when page loads. A standard interface should be defined and documented. | Add javascript with indication and implementation of capabilities to each offliner and load the javascript when page loads. A standard interface should be defined and documented. | ||
Potential capabilities to include: | Potential capabilities to include: | ||
* title | |||
* table of content | |||
** extraction | |||
** scrolling position indicating | |||
** scroll to section | |||
* font | |||
** size | |||
** line spacing | |||
** justification | |||
* night mode |
Revision as of 18:24, 13 October 2017
Overview
Zim files can be seem as a subset and a snapshot of a website. Webpages in the zim file could have totally different structure and layout.
The problem arises when interaction with the webpage is needed, since it is impossible to perform those interactions when there's little information regarding if and how an interaction should be performed.
Some kind of indication should be provided to allow zim readers to turn interactions on or off once a page is loaded. Further, implementations to perform those interactions needs to be included in the zim file itself.
Motivation
A basic function of zim readers is to provide a table of content of an article. But it is impossible come up with one javascript function to extract table of content in all sorts of zim files. It would make sense for each webpage to come with its own `getTableOfContent()` and `scrollToSection()` function. Some webpages, such as phet or main page, it might make little sense to provide table of content. A way to check `hasTableOfContent` could also be provided.
Proposed Solution
Add javascript with indication and implementation of capabilities to each offliner and load the javascript when page loads. A standard interface should be defined and documented.
Potential capabilities to include:
- title
- table of content
- extraction
- scrolling position indicating
- scroll to section
- font
- size
- line spacing
- justification
- night mode