mirror of
https://github.com/ankitects/anki.git
synced 2025-11-06 20:57:13 -05:00
only use jquery ui in deck browser screen
This commit is contained in:
parent
8e6e7bb39f
commit
b2919f285d
2 changed files with 6 additions and 3 deletions
|
|
@ -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):
|
||||||
|
|
|
||||||
|
|
@ -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):
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue