diff --git a/aqt/editor.py b/aqt/editor.py index 1b70bb2b7..3ffa64bec 100644 --- a/aqt/editor.py +++ b/aqt/editor.py @@ -412,7 +412,7 @@ class Editor(object): self.note = note # change timer if self.note: - self.web.setHtml(_html % (getBase(self.mw.col), anki.js.all, + self.web.setHtml(_html % (getBase(self.mw.col), anki.js.jquery, (isMac or isWin) and 1 or 0, _("Show Duplicates")), loadCB=self._loadFinished) diff --git a/aqt/reviewer.py b/aqt/reviewer.py index b3f6e153f..35706360a 100644 --- a/aqt/reviewer.py +++ b/aqt/reviewer.py @@ -93,7 +93,7 @@ class Reviewer(object): var ankiPlatform = "desktop"; var typeans; function _updateQA (q, answerMode) { - $("#qa").html(q); + $("#qa")[0].innerHTML = q; typeans = document.getElementById("typeans"); if (typeans) { typeans.focus(); @@ -117,10 +117,17 @@ function _typeAnsPress() { def _initWeb(self): self._reps = 0 + self._bottomReady = False base = getBase(self.mw.col) + # main window self.web.stdHtml(self._revHtml, self._styles(), bodyClass="card", loadCB=lambda x: self._showQuestion(), head=base) + # show answer / ease buttons + self.bottom.web.stdHtml( + self._bottomHTML(), + self.bottom._css + self._bottomCSS, + loadCB=lambda x: self._showAnswerButton()) # Showing the question ########################################################################## @@ -141,8 +148,8 @@ function _typeAnsPress() { q = self._mungeQA(q) self.web.eval("_updateQA(%s);" % simplejson.dumps(q)) t = time.time() - self._showAnswerButton() - print (time.time() - t)*1000 + if self._bottomReady: + self._showAnswerButton() # if we have a type answer field, focus main web if self.typeCorrect: self.mw.web.setFocus() @@ -393,7 +400,7 @@ td { font-weight: bold; font-size: 12px; } .spacer2 { height: 16px; } """ - def _bottomHTML(self, middle): + def _bottomHTML(self): if not self.card.deckConf().get('timer'): maxTime = 0 else: @@ -404,8 +411,7 @@ td { font-weight: bold; font-size: 12px; }
%s |