Grammalecte  Check-in [6727222f1a]

Overview
Comment:[doc] Web API update
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk | doc
Files: files | file ages | folders
SHA3-256: 6727222f1a51ce73af503018faab9e16fa59fb0fb2f287ec2b48c652320a075f
User & Date: olr on 2020-03-19 08:19:34
Other Links: manifest | tags
Context
2020-03-19
08:20
[doc] Web API update check-in: d353472e17 user: olr tags: doc, trunk
08:19
[doc] Web API update check-in: 6727222f1a user: olr tags: doc, trunk
08:10
[doc] Web API update check-in: 6cd37e7067 user: olr tags: doc, trunk
Changes

Modified doc/API_web.md from [a4bf78ddb6] to [c344f75300].

    16     16   
    17     17   - get the modified text via events (instead of having the node content directly modified),
    18     18   
    19     19   - get raw results (list of errors) of grammar checking and spell checking,
    20     20   
    21     21   - get spelling suggestions for a wrong word.
    22     22   
    23         -
    24         -### Version of the Grammalecte Web API
    25         -
    26         -    oGrammalecteAPI.sVersion
    27         -
    28     23   
    29     24   ### How it works
    30     25   
    31     26   Usually, webpage scripts can’t call methods or functions of browser extensions.
    32     27   
    33     28   The Grammalecte API is injected within your webpage, with methods launching events that Grammalecte is listening. When Grammalecte receives one of these events, it launches the requested tasks. Results may be sent via events on webpage nodes.
           29  +
           30  +For information purpose only, here are the layers of code explaining with you can’t access directly to the grammar checker:
           31  +
           32  +    ·> webpage script
           33  +    <> Grammalecte API (injected by the content-script, callable by the webpage script)
           34  +    <> Content-script (injected by the extension, not callable by the webpage script)
           35  +    <> Background script (extension core)
           36  +    <· Worker running the grammar checker on a different process
           37  +
           38  +### Version of the Grammalecte Web API
           39  +
           40  +    oGrammalecteAPI.sVersion
    34     41   
    35     42   
    36     43   ### Detecting if Grammalecte API is here
    37     44   
    38     45   Every call to the Grammalecte API will be done via an object called `oGrammalecteAPI`.
    39     46   
    40     47       if (typeof(oGrammalecteAPI) === "object") {