mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 14:32:22 -04:00
Fix: correct typo and adjust indentation in docstring (#3920)
* fix: correct typo and adjust indentation in docstring Fixed a small typo in the webview_did_inject_style_into_page docstring and adjusted indentation for consistency. * Update CONTRIBUTORS
This commit is contained in:
parent
9d167feb8f
commit
066f5fd281
2 changed files with 19 additions and 18 deletions
|
@ -220,6 +220,7 @@ Valerie Enfys <val@unidentified.systems>
|
|||
Julien Chol <https://github.com/chel-ou>
|
||||
ikkz <ylei.mk@gmail.com>
|
||||
rreemmii-dev <https://github.com/rreemmii-dev>
|
||||
babofitos <https://github.com/babofitos>
|
||||
|
||||
********************
|
||||
|
||||
|
|
|
@ -778,24 +778,24 @@ hooks = [
|
|||
name="webview_did_inject_style_into_page",
|
||||
args=["webview: aqt.webview.AnkiWebView"],
|
||||
doc='''Called after standard styling is injected into an external
|
||||
html file, such as when loading the new graphs. You can use this hook to
|
||||
mutate the DOM before the page is revealed.
|
||||
|
||||
For example:
|
||||
|
||||
def mytest(webview: AnkiWebView):
|
||||
if webview.kind != AnkiWebViewKind.DECK_STATS:
|
||||
return
|
||||
web.eval(
|
||||
"""
|
||||
div = document.createElement("div");
|
||||
div.innerHTML = 'hello';
|
||||
document.body.appendChild(div);
|
||||
"""
|
||||
)
|
||||
|
||||
gui_hooks.webview_did_inject_style_into_page.append(mytest)
|
||||
''',
|
||||
html file, such as when loading the new graphs. You can use this hook to
|
||||
mutate the DOM before the page is revealed.
|
||||
|
||||
For example:
|
||||
|
||||
def mytest(webview: AnkiWebView):
|
||||
if webview.kind != AnkiWebViewKind.DECK_STATS:
|
||||
return
|
||||
webview.eval(
|
||||
"""
|
||||
div = document.createElement("div");
|
||||
div.innerHTML = 'hello';
|
||||
document.body.appendChild(div);
|
||||
"""
|
||||
)
|
||||
|
||||
gui_hooks.webview_did_inject_style_into_page.append(mytest)
|
||||
''',
|
||||
),
|
||||
# Main
|
||||
###################
|
||||
|
|
Loading…
Reference in a new issue