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.qt import *
from aqt.utils import askUser, getOnlyText, openLink, showWarning from aqt.utils import askUser, getOnlyText, openLink, showWarning
from anki.utils import isMac from anki.utils import isMac
import anki.js
from anki.errors import DeckRenameError from anki.errors import DeckRenameError
import aqt import aqt
@ -105,7 +106,8 @@ body { margin: 1em; -webkit-user-select: none; }
def _renderPage(self): def _renderPage(self):
css = self.mw.sharedCSS + self._css css = self.mw.sharedCSS + self._css
tree = self._renderDeckTree(self.mw.col.sched.deckDueTree()) 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() self._drawButtons()
def _renderDeckTree(self, nodes, depth=0): def _renderDeckTree(self, nodes, depth=0):

View file

@ -81,7 +81,7 @@ 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="", bodyClass="", loadCB=None, head=""): def stdHtml(self, body, css="", bodyClass="", loadCB=None, js=None, head=""):
if isMac: if isMac:
button = "font-weight: bold; height: 24px;" button = "font-weight: bold; height: 24px;"
else: else:
@ -98,7 +98,8 @@ button {
</head> </head>
<body class="%s">%s</body></html>""" % ( <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): def setBridge(self, bridge):
self._bridge.setBridge(bridge) self._bridge.setBridge(bridge)
def eval(self, js): def eval(self, js):