mirror of
https://github.com/ankitects/anki.git
synced 2025-11-07 13:17:12 -05:00
card is a class not an id now
This commit is contained in:
parent
5c80708765
commit
a8b90ca6b0
3 changed files with 5 additions and 5 deletions
|
|
@ -156,7 +156,7 @@ Please create a new card first."""))
|
||||||
def renderPreview(self):
|
def renderPreview(self):
|
||||||
c = self.card
|
c = self.card
|
||||||
styles = "\n.cloze { font-weight: bold; color: blue; }"
|
styles = "\n.cloze { font-weight: bold; color: blue; }"
|
||||||
html = '''<html><head>%s</head><body id=card>
|
html = '''<html><head>%s</head><body class=card>
|
||||||
<style>%s</style>%s</body></html>'''
|
<style>%s</style>%s</body></html>'''
|
||||||
ti = self.maybeTextInput
|
ti = self.maybeTextInput
|
||||||
base = getBase(self.mw.col)
|
base = getBase(self.mw.col)
|
||||||
|
|
|
||||||
|
|
@ -109,7 +109,7 @@ function _typeAnsPress() {
|
||||||
def _initWeb(self):
|
def _initWeb(self):
|
||||||
base = getBase(self.mw.col)
|
base = getBase(self.mw.col)
|
||||||
self.web.stdHtml(self._revHtml, self._styles(),
|
self.web.stdHtml(self._revHtml, self._styles(),
|
||||||
bodyID="card", loadCB=lambda x: self._showQuestion(),
|
bodyClass="card", loadCB=lambda x: self._showQuestion(),
|
||||||
head=base)
|
head=base)
|
||||||
|
|
||||||
# Showing the question
|
# Showing the question
|
||||||
|
|
|
||||||
|
|
@ -79,14 +79,14 @@ class AnkiWebView(QWebView):
|
||||||
def setHtml(self, html, loadCB=None):
|
def setHtml(self, html, loadCB=None):
|
||||||
self._loadFinishedCB = loadCB
|
self._loadFinishedCB = loadCB
|
||||||
QWebView.setHtml(self, html)
|
QWebView.setHtml(self, html)
|
||||||
def stdHtml(self, body, css="", bodyID="", loadCB=None, head=""):
|
def stdHtml(self, body, css="", bodyClass="", loadCB=None, head=""):
|
||||||
self.setHtml("""
|
self.setHtml("""
|
||||||
<html><head><style>%s</style>
|
<html><head><style>%s</style>
|
||||||
<script>%s</script>
|
<script>%s</script>
|
||||||
%s
|
%s
|
||||||
</head>
|
</head>
|
||||||
<body id="%s">%s</body></html>""" % (
|
<body class="%s">%s</body></html>""" % (
|
||||||
css, anki.js.all, head, bodyID, body), loadCB)
|
css, anki.js.all, head, bodyClass, body), loadCB)
|
||||||
def setBridge(self, bridge):
|
def setBridge(self, bridge):
|
||||||
self._bridge.setBridge(bridge)
|
self._bridge.setBridge(bridge)
|
||||||
def eval(self, js):
|
def eval(self, js):
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue