mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 14:02:21 -04:00
Simplify the format string (#3293)
* refactor: simplify format string * chore: add myself to CONTRIBUTORS file
This commit is contained in:
parent
56a085bc21
commit
9d8782c31c
2 changed files with 5 additions and 12 deletions
|
@ -177,6 +177,7 @@ RRomeroJr <117.rromero@gmail.com>
|
||||||
Xidorn Quan <me@upsuper.org>
|
Xidorn Quan <me@upsuper.org>
|
||||||
Alexander Bocken <alexander@bocken.org>
|
Alexander Bocken <alexander@bocken.org>
|
||||||
James Elmore <email@jameselmore.org>
|
James Elmore <email@jameselmore.org>
|
||||||
|
David Culley <6276049+davidculley@users.noreply.github.com>
|
||||||
Rastislav Kish <rastislav.kish@protonmail.com>
|
Rastislav Kish <rastislav.kish@protonmail.com>
|
||||||
|
|
||||||
********************
|
********************
|
||||||
|
|
|
@ -323,25 +323,17 @@ require("anki/ui").loaded.then(() => require("anki/NoteEditor").instances[0].too
|
||||||
class_ = "rounded"
|
class_ = "rounded"
|
||||||
if not disables:
|
if not disables:
|
||||||
class_ += " perm"
|
class_ += " perm"
|
||||||
return """<button tabindex=-1
|
return f"""<button tabindex=-1
|
||||||
{id}
|
{idstr}
|
||||||
class="{class_}"
|
class="{class_}"
|
||||||
type="button"
|
type="button"
|
||||||
title="{tip}"
|
title="{tip}"
|
||||||
onclick="pycmd('{cmd}');{togglesc}return false;"
|
onclick="pycmd('{cmd}');{toggleScript}return false;"
|
||||||
onmousedown="window.event.preventDefault();"
|
onmousedown="window.event.preventDefault();"
|
||||||
>
|
>
|
||||||
{imgelm}
|
{imgelm}
|
||||||
{labelelm}
|
{labelelm}
|
||||||
</button>""".format(
|
</button>"""
|
||||||
imgelm=imgelm,
|
|
||||||
cmd=cmd,
|
|
||||||
tip=tip,
|
|
||||||
labelelm=labelelm,
|
|
||||||
id=idstr,
|
|
||||||
togglesc=toggleScript,
|
|
||||||
class_=class_,
|
|
||||||
)
|
|
||||||
|
|
||||||
def setupShortcuts(self) -> None:
|
def setupShortcuts(self) -> None:
|
||||||
# if a third element is provided, enable shortcut even when no field selected
|
# if a third element is provided, enable shortcut even when no field selected
|
||||||
|
|
Loading…
Reference in a new issue