only use jquery ui in deck browser screen

This commit is contained in:
Damien Elmes 2012-02-24 20:51:24 +09:00
parent 8e6e7bb39f
commit b2919f285d
2 changed files with 6 additions and 3 deletions

View file

@ -5,6 +5,7 @@
from aqt.qt import *
from aqt.utils import askUser, getOnlyText, openLink, showWarning
from anki.utils import isMac
import anki.js
from anki.errors import DeckRenameError
import aqt
@ -105,7 +106,8 @@ body { margin: 1em; -webkit-user-select: none; }
def _renderPage(self):
css = self.mw.sharedCSS + self._css
tree = self._renderDeckTree(self.mw.col.sched.deckDueTree())
self.web.stdHtml(self._body%dict(tree=tree), css=css)
self.web.stdHtml(self._body%dict(tree=tree), css=css,
js=anki.js.jquery+anki.js.ui)
self._drawButtons()
def _renderDeckTree(self, nodes, depth=0):

View file

@ -81,7 +81,7 @@ class AnkiWebView(QWebView):
def setHtml(self, html, loadCB=None):
self._loadFinishedCB = loadCB
QWebView.setHtml(self, html)
def stdHtml(self, body, css="", bodyClass="", loadCB=None, head=""):
def stdHtml(self, body, css="", bodyClass="", loadCB=None, js=None, head=""):
if isMac:
button = "font-weight: bold; height: 24px;"
else:
@ -98,7 +98,8 @@ button {
</head>
<body class="%s">%s</body></html>""" % (
fontForPlatform(), button, css, anki.js.all, head, bodyClass, body), loadCB)
fontForPlatform(), button, css, js or anki.js.jquery, head,
bodyClass, body), loadCB)
def setBridge(self, bridge):
self._bridge.setBridge(bridge)
def eval(self, js):