mirror of
https://github.com/ankitects/anki.git
synced 2025-09-20 06:52:21 -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>
|
Julien Chol <https://github.com/chel-ou>
|
||||||
ikkz <ylei.mk@gmail.com>
|
ikkz <ylei.mk@gmail.com>
|
||||||
rreemmii-dev <https://github.com/rreemmii-dev>
|
rreemmii-dev <https://github.com/rreemmii-dev>
|
||||||
|
babofitos <https://github.com/babofitos>
|
||||||
|
|
||||||
********************
|
********************
|
||||||
|
|
||||||
|
|
|
@ -778,24 +778,24 @@ hooks = [
|
||||||
name="webview_did_inject_style_into_page",
|
name="webview_did_inject_style_into_page",
|
||||||
args=["webview: aqt.webview.AnkiWebView"],
|
args=["webview: aqt.webview.AnkiWebView"],
|
||||||
doc='''Called after standard styling is injected into an external
|
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
|
html file, such as when loading the new graphs. You can use this hook to
|
||||||
mutate the DOM before the page is revealed.
|
mutate the DOM before the page is revealed.
|
||||||
|
|
||||||
For example:
|
For example:
|
||||||
|
|
||||||
def mytest(webview: AnkiWebView):
|
def mytest(webview: AnkiWebView):
|
||||||
if webview.kind != AnkiWebViewKind.DECK_STATS:
|
if webview.kind != AnkiWebViewKind.DECK_STATS:
|
||||||
return
|
return
|
||||||
web.eval(
|
webview.eval(
|
||||||
"""
|
"""
|
||||||
div = document.createElement("div");
|
div = document.createElement("div");
|
||||||
div.innerHTML = 'hello';
|
div.innerHTML = 'hello';
|
||||||
document.body.appendChild(div);
|
document.body.appendChild(div);
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
|
|
||||||
gui_hooks.webview_did_inject_style_into_page.append(mytest)
|
gui_hooks.webview_did_inject_style_into_page.append(mytest)
|
||||||
''',
|
''',
|
||||||
),
|
),
|
||||||
# Main
|
# Main
|
||||||
###################
|
###################
|
||||||
|
|
Loading…
Reference in a new issue