diff --git a/aqt/about.py b/aqt/about.py
index c179684ea..c361d9e40 100644
--- a/aqt/about.py
+++ b/aqt/about.py
@@ -19,7 +19,7 @@ system. It's free and open source.")
abouttext += '
' + _("Written by Damien Elmes, with patches, translation,\
testing and design from:
%(cont)s") % {'cont': u"""
-Andreas Klauer, Andrew Wright, Bernhard Ibertsberger, Charlene
+Alex Fraser, Andreas Klauer, Andrew Wright, Bernhard Ibertsberger, Charlene
Barina, Christian Rusche, David Smith, Dave Druelinger, Dotan Cohen, Emilio
Wuerges, Emmanuel Jarri, Frank Harper, H. Mijail, Ian Lewis, Iroiro, Jin
Eun-Deok, Jarvik7, Jo Nakashima, Christian Krause, LaC, Laurent Steffan, Marco
@@ -30,12 +30,8 @@ Petr Michalec, Piotr Kubowicz, Richard Colley, Samson Melamed, Stefaan
De Pooter, Susanna Björverud, Tacutu, Timm Preetz, Timo Paulssen, Ursus, Victor
Suba, and Xtru.
-Anki icon by Alex Fraser (CC GNU GPL)
-Deck icon: Be Box Icons (free for non-commercial use)
-Deck browser icons from:
-http://led24.de/iconset
-http://p.yusukekamiyamane.com/
-Other icons under LGPL or public domain.
+The icons were obtained from various sources; please see the Anki source
+for credits.
"""
}
diff --git a/aqt/browser.py b/aqt/browser.py
index 0c24a81aa..9709e07e1 100644
--- a/aqt/browser.py
+++ b/aqt/browser.py
@@ -1447,7 +1447,7 @@ class BrowserToolbar(Toolbar):
self.web.stdHtml(self._body % (
"",
self._centerLinks(),
- right), self._css, focus=False)
+ right), self._css)
# Link handling
######################################################################
diff --git a/aqt/main.py b/aqt/main.py
index 18f266e93..ca920eb18 100755
--- a/aqt/main.py
+++ b/aqt/main.py
@@ -292,7 +292,7 @@ background: #f3f3f3;
margin: 2em;
}
h1 { margin-bottom: 0.2em; }
-hr { margin:5 0 5 0; border:0; height:1px; background-color:#ccc; }
+hr { background-color:#ccc; margin: 1em; }
"""
def button(self, link, name, key=None, class_="", id=""):
diff --git a/aqt/overview.py b/aqt/overview.py
index f2440de84..c59606091 100644
--- a/aqt/overview.py
+++ b/aqt/overview.py
@@ -43,7 +43,6 @@ class Overview(object):
def _linkHandler(self, url):
print "link", url
if url == "study":
- self.mw.col.reset()
self.mw.moveToState("review")
elif url == "anki":
print "anki menu"
diff --git a/aqt/reviewer.py b/aqt/reviewer.py
index 6a6b28657..eaf16f7eb 100644
--- a/aqt/reviewer.py
+++ b/aqt/reviewer.py
@@ -33,7 +33,7 @@ class Reviewer(object):
else:
self.nextCard()
self.keep = False
- self.bottom.web.setFixedHeight(60)
+ self.bottom.web.setFixedHeight(46)
self.bottom.web.setLinkHandler(self._linkHandler)
def lastCard(self):
@@ -82,12 +82,17 @@ var ankiPlatform = "desktop";
var hideq;
var ans;
var typeans;
-function _updateQA (q) {
+function _updateQA (q, answerMode) {
$("#qa").html(q);
typeans = document.getElementById("typeans");
if (typeans) {
typeans.focus();
}
+ if (answerMode) {
+ window.location = "#answerStart";
+ } else {
+ window.location = "";
+ }
};
function _showans (a) {
$("#qa").html(a);
@@ -117,15 +122,14 @@ function _typeAnsPress() {
_showans();
}
}
-$(document).ready(function () {
-$(".ansbut").focus();
-});
"""
def _initWeb(self):
+ base = getBase(self.mw.col)
self.web.stdHtml(self._revHtml, self._styles(),
- bodyID="card", loadCB=lambda x: self._showQuestion())
+ bodyID="card", loadCB=lambda x: self._showQuestion(),
+ head=base)
# Showing the question
##########################################################################
@@ -143,12 +147,12 @@ $(".ansbut").focus();
q = c.q()
if self.mw.pm.profile['autoplay']:
playFromText(q)
- # render
+ # render & update bottom
q = self._mungeQA(q)
self.web.eval("_updateQA(%s);" % simplejson.dumps(q))
- runHook('showQuestion')
- # and refresh bottom bar
self._showAnswerButton()
+ # user hook
+ runHook('showQuestion')
# Showing the answer
##########################################################################
@@ -157,54 +161,16 @@ $(".ansbut").focus();
self.state = "answer"
c = self.card
a = c.a()
+ # play audio?
if self.mw.pm.profile['autoplay']:
playFromText(a)
- # render
+ # render and update bottom
+ a = self._mungeQA(a)
+ self.web.eval("_updateQA(%s, true);" % simplejson.dumps(a))
+ self._showEaseButtons()
+ # user hook
runHook('showAnswer')
- # Ease buttons
- ##########################################################################
-
- def _defaultEase(self):
- if self.mw.col.sched.answerButtons(self.card) == 4:
- return 3
- else:
- return 2
-
- def _answerButtons(self):
- if self.mw.col.sched.answerButtons(self.card) == 4:
- labels = (_("Again"), _("Hard"), _("Good"), _("Easy"))
- else:
- labels = (_("Again"), _("Good"), _("Easy"))
- times = []
- buttons = []
- default = self._defaultEase()
- def but(label, i):
- if i == default:
- extra=" id=defease"
- else:
- extra = ""
- return '''
-%s''' % (extra, i, label)
- for i in range(0, len(labels)):
- l = labels[i]
- l += " %s" % self._buttonTime(i, default-1)
- buttons.append(but(l, i+1))
- buf = ("
+
+""" % dict(middle=middle)
+
def _showAnswerButton(self):
+ self.bottom.web.setFocus()
+ middle = '''
+
+''' % _("Show Answer")
+ # wrap it in a table so it has the same top margin as the ease buttons
+ middle = "