card is a class not an id now

This commit is contained in:
Damien Elmes 2011-12-07 20:27:08 +09:00
parent 5c80708765
commit a8b90ca6b0
3 changed files with 5 additions and 5 deletions

View file

@ -156,7 +156,7 @@ Please create a new card first."""))
def renderPreview(self):
c = self.card
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>'''
ti = self.maybeTextInput
base = getBase(self.mw.col)

View file

@ -109,7 +109,7 @@ function _typeAnsPress() {
def _initWeb(self):
base = getBase(self.mw.col)
self.web.stdHtml(self._revHtml, self._styles(),
bodyID="card", loadCB=lambda x: self._showQuestion(),
bodyClass="card", loadCB=lambda x: self._showQuestion(),
head=base)
# Showing the question

View file

@ -79,14 +79,14 @@ class AnkiWebView(QWebView):
def setHtml(self, html, loadCB=None):
self._loadFinishedCB = loadCB
QWebView.setHtml(self, html)
def stdHtml(self, body, css="", bodyID="", loadCB=None, head=""):
def stdHtml(self, body, css="", bodyClass="", loadCB=None, head=""):
self.setHtml("""
<html><head><style>%s</style>
<script>%s</script>
%s
</head>
<body id="%s">%s</body></html>""" % (
css, anki.js.all, head, bodyID, body), loadCB)
<body class="%s">%s</body></html>""" % (
css, anki.js.all, head, bodyClass, body), loadCB)
def setBridge(self, bridge):
self._bridge.setBridge(bridge)
def eval(self, js):