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