Codebase list anki / upstream/2.1.0+dfsg_b21
New upstream version 2.1.0+dfsg~b21 Julian Gilbey 6 years ago
81 changed file(s) with 340 addition(s) and 423 deletion(s). Raw diff Collapse all Expand all
99 if sys.getfilesystemencoding().lower() in ("ascii", "ansi_x3.4-1968"):
1010 raise Exception("Anki requires a UTF-8 locale.")
1111
12 version="2.1.0beta20" # build scripts grep this line, so preserve formatting
12 version="2.1.0beta21" # build scripts grep this line, so preserve formatting
1313 from anki.storage import Collection
1414 __all__ = ["Collection"]
134134 else:
135135 args = tuple()
136136 self._qa = self.col._renderQA(data, *args)
137 if m.get("prewrap", False):
138 wsdiv = "<div style='white-space:pre-wrap;'>{}</div>"
139 self._qa['q'] = wsdiv.format(self._qa['q'])
140 self._qa['a'] = wsdiv.format(self._qa['a'])
141137 return self._qa
142138
143139 def note(self, reload=False):
188188 strings = []
189189 from anki.template.template import clozeReg
190190 def qrepl(m):
191 if m.group(3):
192 return "[%s]" % m.group(3)
191 if m.group(4):
192 return "[%s]" % m.group(4)
193193 else:
194194 return "[...]"
195195 def arepl(m):
196 return m.group(1)
196 return m.group(2)
197197 for ord in ords:
198198 s = re.sub(clozeReg%ord, qrepl, string)
199 s = re.sub(clozeReg%".+?", "\\2", s)
199 s = re.sub(clozeReg%".+?", "\\4", s)
200200 strings.append(s)
201201 strings.append(re.sub(clozeReg%".+?", arepl, string))
202202 return strings
5252 recFiles = []
5353
5454 processingChain = [
55 ["lame", "rec.wav", processingDst, "--noreplaygain", "--quiet"],
55 ["lame", processingSrc, processingDst, "--noreplaygain", "--quiet"],
5656 ]
5757
5858 # don't show box on windows
276276 ret = retryWait(subprocess.Popen(cmd, startupinfo=si, env=env))
277277 except:
278278 ret = True
279 finally:
280 if os.path.exists(processingSrc):
281 os.unlink(processingSrc)
279282 if ret:
280283 raise Exception(_(
281284 "Error running %s") %
2323 openHelp, tooltip, downArrow
2424 import aqt
2525 from bs4 import BeautifulSoup
26 import requests
2627
2728 pics = ("jpg", "jpeg", "png", "tif", "tiff", "gif", "svg", "webp")
2829 audio = ("wav", "mp3", "ogg", "flac", "mp4", "swf", "mov", "mpeg", "mkv", "m4a", "3gp", "spx", "oga")
296297 self.web.setFocus()
297298 runHook("loadNote", self)
298299
299 self.web.evalWithCallback("setFields(%s, %s); setFonts(%s); focusField(%s)" % (
300 json.dumps(data), json.dumps(self.prewrapMode()),
300 self.web.evalWithCallback("setFields(%s); setFonts(%s); focusField(%s)" % (
301 json.dumps(data),
301302 json.dumps(self.fonts()), json.dumps(focusTo)),
302303 oncallback)
303
304 def prewrapMode(self):
305 return self.note.model().get('prewrap', False)
306304
307305 def fonts(self):
308306 return [(f['font'], f['size'], f['rtl'])
566564 def urlToFile(self, url):
567565 l = url.lower()
568566 for suffix in pics+audio:
569 if l.endswith(suffix):
567 if l.endswith("." + suffix):
570568 return self._retrieveURL(url)
571569 # not a supported type
572570 return
586584 if url.lower().startswith("file://"):
587585 url = url.replace("%", "%25")
588586 url = url.replace("#", "%23")
587 local = True
588 else:
589 local = False
589590 # fetch it into a temporary folder
590591 self.mw.progress.start(
591592 immediate=True, parent=self.parentWindow)
592593 try:
593 req = urllib.request.Request(url, None, {
594 'User-Agent': 'Mozilla/5.0 (compatible; Anki)'})
595 filecontents = urllib.request.urlopen(req).read()
594 if local:
595 req = urllib.request.Request(url, None, {
596 'User-Agent': 'Mozilla/5.0 (compatible; Anki)'})
597 filecontents = urllib.request.urlopen(req).read()
598 else:
599 r = requests.get(url)
600 if r.status_code != 200:
601 showWarning(_("Unexpected response code: %s") % r.status_code)
602 return
603 filecontents = r.content
596604 except urllib.error.URLError as e:
597605 showWarning(_("An error occurred while opening %s") % e)
598606 return
615623 for node in doc(tag):
616624 node.decompose()
617625
618 if not self.prewrapMode():
619 # convert p tags to divs
620 for node in doc("p"):
621 node.name = "div"
626 # convert p tags to divs
627 for node in doc("p"):
628 node.name = "div"
622629
623630 for tag in doc("img"):
624631 try:
638645 def doPaste(self, html, internal):
639646 if not internal:
640647 html = self._pastePreFilter(html)
641 self.web.eval("pasteHTML(%s, %s);" % (
642 json.dumps(html), json.dumps(internal)))
648 extended = self.mw.app.queryKeyboardModifiers() & Qt.ShiftModifier
649 if extended:
650 extended = "true"
651 else:
652 extended = "false"
653 self.web.eval("pasteHTML(%s, %s, %s);" % (
654 json.dumps(html), json.dumps(internal), extended))
643655
644656 def doDrop(self, html, internal):
645657 self.web.evalWithCallback("makeDropTargetCurrent();",
+0
-43
aqt/forms/.py less more
0 # -*- coding: utf-8 -*-
1
2 # Form implementation generated from reading ui file 'designer/about.ui'
3 #
4 # Created by: PyQt5 UI code generator 5.9
5 #
6 # WARNING! All changes made in this file will be lost!
7
8 from PyQt5 import QtCore, QtGui, QtWidgets
9
10 class Ui_About(object):
11 def setupUi(self, About):
12 About.setObjectName("About")
13 About.resize(410, 664)
14 sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Minimum)
15 sizePolicy.setHorizontalStretch(0)
16 sizePolicy.setVerticalStretch(0)
17 sizePolicy.setHeightForWidth(About.sizePolicy().hasHeightForWidth())
18 About.setSizePolicy(sizePolicy)
19 self.vboxlayout = QtWidgets.QVBoxLayout(About)
20 self.vboxlayout.setContentsMargins(0, 0, 0, 0)
21 self.vboxlayout.setObjectName("vboxlayout")
22 self.label = AnkiWebView(About)
23 self.label.setProperty("url", QtCore.QUrl("about:blank"))
24 self.label.setObjectName("label")
25 self.vboxlayout.addWidget(self.label)
26 self.buttonBox = QtWidgets.QDialogButtonBox(About)
27 self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
28 self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Ok)
29 self.buttonBox.setObjectName("buttonBox")
30 self.vboxlayout.addWidget(self.buttonBox)
31
32 self.retranslateUi(About)
33 self.buttonBox.accepted.connect(About.accept)
34 self.buttonBox.rejected.connect(About.reject)
35 QtCore.QMetaObject.connectSlotsByName(About)
36
37 def retranslateUi(self, About):
38 _translate = QtCore.QCoreApplication.translate
39 About.setWindowTitle(_translate("About", "About Anki"))
40
41 from aqt.webview import AnkiWebView
42 from . import icons_rc
88 from PyQt5 import QtCore
99
1010 qt_resource_data = b"\
11 \x00\x00\x05\x69\
12 \x3c\
13 \x3f\x78\x6d\x6c\x20\x76\x65\x72\x73\x69\x6f\x6e\x3d\x22\x31\x2e\
14 \x30\x22\x20\x65\x6e\x63\x6f\x64\x69\x6e\x67\x3d\x22\x55\x54\x46\
15 \x2d\x38\x22\x20\x73\x74\x61\x6e\x64\x61\x6c\x6f\x6e\x65\x3d\x22\
16 \x6e\x6f\x22\x3f\x3e\x0a\x3c\x21\x44\x4f\x43\x54\x59\x50\x45\x20\
17 \x73\x76\x67\x20\x50\x55\x42\x4c\x49\x43\x20\x22\x2d\x2f\x2f\x57\
18 \x33\x43\x2f\x2f\x44\x54\x44\x20\x53\x56\x47\x20\x31\x2e\x31\x2f\
19 \x2f\x45\x4e\x22\x20\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\
20 \x2e\x77\x33\x2e\x6f\x72\x67\x2f\x47\x72\x61\x70\x68\x69\x63\x73\
21 \x2f\x53\x56\x47\x2f\x31\x2e\x31\x2f\x44\x54\x44\x2f\x73\x76\x67\
22 \x31\x31\x2e\x64\x74\x64\x22\x3e\x0a\x3c\x73\x76\x67\x20\x77\x69\
23 \x64\x74\x68\x3d\x22\x31\x30\x30\x25\x22\x20\x68\x65\x69\x67\x68\
24 \x74\x3d\x22\x31\x30\x30\x25\x22\x20\x76\x69\x65\x77\x42\x6f\x78\
25 \x3d\x22\x30\x20\x30\x20\x36\x30\x20\x36\x30\x22\x20\x76\x65\x72\
26 \x73\x69\x6f\x6e\x3d\x22\x31\x2e\x31\x22\x20\x78\x6d\x6c\x6e\x73\
27 \x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\
28 \x6f\x72\x67\x2f\x32\x30\x30\x30\x2f\x73\x76\x67\x22\x20\x78\x6d\
29 \x6c\x6e\x73\x3a\x78\x6c\x69\x6e\x6b\x3d\x22\x68\x74\x74\x70\x3a\
30 \x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\x72\x67\x2f\x31\x39\x39\
31 \x39\x2f\x78\x6c\x69\x6e\x6b\x22\x20\x78\x6d\x6c\x3a\x73\x70\x61\
32 \x63\x65\x3d\x22\x70\x72\x65\x73\x65\x72\x76\x65\x22\x20\x73\x74\
33 \x79\x6c\x65\x3d\x22\x66\x69\x6c\x6c\x2d\x72\x75\x6c\x65\x3a\x65\
34 \x76\x65\x6e\x6f\x64\x64\x3b\x63\x6c\x69\x70\x2d\x72\x75\x6c\x65\
35 \x3a\x65\x76\x65\x6e\x6f\x64\x64\x3b\x73\x74\x72\x6f\x6b\x65\x2d\
36 \x6c\x69\x6e\x65\x63\x61\x70\x3a\x72\x6f\x75\x6e\x64\x3b\x73\x74\
37 \x72\x6f\x6b\x65\x2d\x6c\x69\x6e\x65\x6a\x6f\x69\x6e\x3a\x72\x6f\
38 \x75\x6e\x64\x3b\x73\x74\x72\x6f\x6b\x65\x2d\x6d\x69\x74\x65\x72\
39 \x6c\x69\x6d\x69\x74\x3a\x31\x2e\x35\x3b\x22\x3e\x0a\x20\x20\x20\
40 \x20\x3c\x67\x20\x74\x72\x61\x6e\x73\x66\x6f\x72\x6d\x3d\x22\x6d\
41 \x61\x74\x72\x69\x78\x28\x31\x2c\x30\x2c\x30\x2c\x31\x2c\x2d\x32\
42 \x31\x30\x2c\x30\x29\x22\x3e\x0a\x20\x20\x20\x20\x20\x20\x20\x20\
43 \x3c\x67\x20\x69\x64\x3d\x22\x64\x65\x63\x6b\x22\x20\x74\x72\x61\
44 \x6e\x73\x66\x6f\x72\x6d\x3d\x22\x6d\x61\x74\x72\x69\x78\x28\x31\
45 \x2c\x30\x2c\x30\x2c\x31\x2c\x2d\x31\x34\x38\x31\x2c\x30\x29\x22\
46 \x3e\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x3c\x72\
47 \x65\x63\x74\x20\x78\x3d\x22\x31\x36\x39\x31\x22\x20\x79\x3d\x22\
48 \x30\x22\x20\x77\x69\x64\x74\x68\x3d\x22\x36\x30\x22\x20\x68\x65\
49 \x69\x67\x68\x74\x3d\x22\x36\x30\x22\x20\x73\x74\x79\x6c\x65\x3d\
50 \x22\x66\x69\x6c\x6c\x3a\x6e\x6f\x6e\x65\x3b\x22\x2f\x3e\x0a\x20\
51 \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x3c\x67\x20\x74\x72\
52 \x61\x6e\x73\x66\x6f\x72\x6d\x3d\x22\x6d\x61\x74\x72\x69\x78\x28\
53 \x31\x2e\x33\x34\x36\x35\x34\x2c\x30\x2e\x30\x30\x33\x33\x35\x39\
54 \x30\x34\x2c\x2d\x30\x2e\x30\x30\x33\x39\x36\x31\x30\x32\x2c\x31\
55 \x2e\x35\x38\x37\x38\x36\x2c\x38\x32\x39\x2e\x30\x31\x39\x2c\x2d\
56 \x33\x2e\x39\x30\x35\x38\x29\x22\x3e\x0a\x20\x20\x20\x20\x20\x20\
57 \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x3c\x70\x61\x74\x68\x20\
58 \x64\x3d\x22\x4d\x36\x37\x33\x2c\x37\x4c\x36\x35\x32\x2c\x37\x4c\
59 \x36\x35\x32\x2c\x31\x30\x2e\x39\x31\x4c\x36\x36\x38\x2e\x32\x30\
60 \x31\x2c\x31\x31\x2e\x30\x31\x33\x4c\x36\x36\x38\x2e\x32\x34\x33\
61 \x2c\x33\x32\x2e\x39\x30\x33\x4c\x36\x37\x33\x2c\x33\x32\x2e\x39\
62 \x30\x33\x4c\x36\x37\x33\x2c\x37\x5a\x22\x20\x73\x74\x79\x6c\x65\
63 \x3d\x22\x66\x69\x6c\x6c\x3a\x6e\x6f\x6e\x65\x3b\x73\x74\x72\x6f\
64 \x6b\x65\x3a\x62\x6c\x61\x63\x6b\x3b\x73\x74\x72\x6f\x6b\x65\x2d\
65 \x77\x69\x64\x74\x68\x3a\x31\x2e\x38\x34\x70\x78\x3b\x22\x2f\x3e\
66 \x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x3c\x2f\x67\
67 \x3e\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x3c\x67\
68 \x20\x74\x72\x61\x6e\x73\x66\x6f\x72\x6d\x3d\x22\x6d\x61\x74\x72\
69 \x69\x78\x28\x31\x2e\x33\x34\x36\x35\x34\x2c\x30\x2e\x30\x30\x33\
70 \x33\x35\x39\x30\x34\x2c\x2d\x30\x2e\x30\x30\x33\x39\x36\x31\x30\
71 \x32\x2c\x31\x2e\x35\x38\x37\x38\x36\x2c\x38\x33\x36\x2e\x30\x39\
72 \x36\x2c\x2d\x31\x30\x2e\x33\x34\x32\x29\x22\x3e\x0a\x20\x20\x20\
73 \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x3c\x70\x61\
74 \x74\x68\x20\x64\x3d\x22\x4d\x36\x37\x33\x2c\x37\x4c\x36\x35\x32\
75 \x2c\x37\x4c\x36\x35\x32\x2c\x31\x30\x2e\x39\x31\x4c\x36\x36\x38\
76 \x2e\x32\x30\x31\x2c\x31\x31\x2e\x30\x31\x33\x4c\x36\x36\x38\x2e\
77 \x32\x34\x33\x2c\x33\x32\x2e\x39\x30\x33\x4c\x36\x37\x33\x2c\x33\
78 \x32\x2e\x39\x30\x33\x4c\x36\x37\x33\x2c\x37\x5a\x22\x20\x73\x74\
79 \x79\x6c\x65\x3d\x22\x66\x69\x6c\x6c\x3a\x6e\x6f\x6e\x65\x3b\x73\
80 \x74\x72\x6f\x6b\x65\x3a\x62\x6c\x61\x63\x6b\x3b\x73\x74\x72\x6f\
81 \x6b\x65\x2d\x77\x69\x64\x74\x68\x3a\x31\x2e\x38\x34\x70\x78\x3b\
82 \x22\x2f\x3e\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\
83 \x3c\x2f\x67\x3e\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\
84 \x20\x3c\x67\x20\x74\x72\x61\x6e\x73\x66\x6f\x72\x6d\x3d\x22\x6d\
85 \x61\x74\x72\x69\x78\x28\x31\x2e\x33\x34\x36\x35\x34\x2c\x30\x2e\
86 \x30\x30\x33\x33\x35\x39\x30\x34\x2c\x2d\x30\x2e\x30\x30\x33\x39\
87 \x36\x31\x30\x32\x2c\x31\x2e\x35\x38\x37\x38\x36\x2c\x38\x32\x32\
88 \x2e\x35\x34\x31\x2c\x32\x2e\x35\x32\x30\x39\x31\x29\x22\x3e\x0a\
89 \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\
90 \x3c\x70\x61\x74\x68\x20\x64\x3d\x22\x4d\x36\x37\x33\x2c\x37\x4c\
91 \x36\x35\x32\x2c\x37\x4c\x36\x35\x32\x2c\x33\x32\x2e\x39\x30\x33\
92 \x4c\x36\x37\x33\x2c\x33\x32\x2e\x39\x30\x33\x4c\x36\x37\x33\x2c\
93 \x37\x5a\x22\x20\x73\x74\x79\x6c\x65\x3d\x22\x66\x69\x6c\x6c\x3a\
94 \x6e\x6f\x6e\x65\x3b\x73\x74\x72\x6f\x6b\x65\x3a\x62\x6c\x61\x63\
95 \x6b\x3b\x73\x74\x72\x6f\x6b\x65\x2d\x77\x69\x64\x74\x68\x3a\x31\
96 \x2e\x38\x34\x70\x78\x3b\x22\x2f\x3e\x0a\x20\x20\x20\x20\x20\x20\
97 \x20\x20\x20\x20\x20\x20\x3c\x2f\x67\x3e\x0a\x20\x20\x20\x20\x20\
98 \x20\x20\x20\x3c\x2f\x67\x3e\x0a\x20\x20\x20\x20\x3c\x2f\x67\x3e\
99 \x0a\x3c\x2f\x73\x76\x67\x3e\x0a\
100 \x00\x00\x04\x06\
101 \x3c\
102 \x3f\x78\x6d\x6c\x20\x76\x65\x72\x73\x69\x6f\x6e\x3d\x22\x31\x2e\
103 \x30\x22\x20\x65\x6e\x63\x6f\x64\x69\x6e\x67\x3d\x22\x55\x54\x46\
104 \x2d\x38\x22\x20\x73\x74\x61\x6e\x64\x61\x6c\x6f\x6e\x65\x3d\x22\
105 \x6e\x6f\x22\x3f\x3e\x0a\x3c\x21\x44\x4f\x43\x54\x59\x50\x45\x20\
106 \x73\x76\x67\x20\x50\x55\x42\x4c\x49\x43\x20\x22\x2d\x2f\x2f\x57\
107 \x33\x43\x2f\x2f\x44\x54\x44\x20\x53\x56\x47\x20\x31\x2e\x31\x2f\
108 \x2f\x45\x4e\x22\x20\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\
109 \x2e\x77\x33\x2e\x6f\x72\x67\x2f\x47\x72\x61\x70\x68\x69\x63\x73\
110 \x2f\x53\x56\x47\x2f\x31\x2e\x31\x2f\x44\x54\x44\x2f\x73\x76\x67\
111 \x31\x31\x2e\x64\x74\x64\x22\x3e\x0a\x3c\x73\x76\x67\x20\x77\x69\
112 \x64\x74\x68\x3d\x22\x31\x30\x30\x25\x22\x20\x68\x65\x69\x67\x68\
113 \x74\x3d\x22\x31\x30\x30\x25\x22\x20\x76\x69\x65\x77\x42\x6f\x78\
114 \x3d\x22\x30\x20\x30\x20\x36\x30\x20\x36\x30\x22\x20\x76\x65\x72\
115 \x73\x69\x6f\x6e\x3d\x22\x31\x2e\x31\x22\x20\x78\x6d\x6c\x6e\x73\
116 \x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\
117 \x6f\x72\x67\x2f\x32\x30\x30\x30\x2f\x73\x76\x67\x22\x20\x78\x6d\
118 \x6c\x6e\x73\x3a\x78\x6c\x69\x6e\x6b\x3d\x22\x68\x74\x74\x70\x3a\
119 \x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\x72\x67\x2f\x31\x39\x39\
120 \x39\x2f\x78\x6c\x69\x6e\x6b\x22\x20\x78\x6d\x6c\x3a\x73\x70\x61\
121 \x63\x65\x3d\x22\x70\x72\x65\x73\x65\x72\x76\x65\x22\x20\x73\x74\
122 \x79\x6c\x65\x3d\x22\x66\x69\x6c\x6c\x2d\x72\x75\x6c\x65\x3a\x65\
123 \x76\x65\x6e\x6f\x64\x64\x3b\x63\x6c\x69\x70\x2d\x72\x75\x6c\x65\
124 \x3a\x65\x76\x65\x6e\x6f\x64\x64\x3b\x73\x74\x72\x6f\x6b\x65\x2d\
125 \x6c\x69\x6e\x65\x63\x61\x70\x3a\x72\x6f\x75\x6e\x64\x3b\x73\x74\
126 \x72\x6f\x6b\x65\x2d\x6c\x69\x6e\x65\x6a\x6f\x69\x6e\x3a\x72\x6f\
127 \x75\x6e\x64\x3b\x73\x74\x72\x6f\x6b\x65\x2d\x6d\x69\x74\x65\x72\
128 \x6c\x69\x6d\x69\x74\x3a\x31\x2e\x35\x3b\x22\x3e\x0a\x20\x20\x20\
129 \x20\x3c\x67\x20\x74\x72\x61\x6e\x73\x66\x6f\x72\x6d\x3d\x22\x6d\
130 \x61\x74\x72\x69\x78\x28\x31\x2c\x30\x2c\x30\x2c\x31\x2c\x2d\x32\
131 \x38\x30\x2c\x30\x29\x22\x3e\x0a\x20\x20\x20\x20\x20\x20\x20\x20\
132 \x3c\x67\x20\x69\x64\x3d\x22\x68\x65\x61\x72\x74\x22\x20\x74\x72\
133 \x61\x6e\x73\x66\x6f\x72\x6d\x3d\x22\x6d\x61\x74\x72\x69\x78\x28\
134 \x31\x2c\x30\x2c\x30\x2c\x31\x2c\x2d\x31\x34\x31\x31\x2c\x30\x29\
135 \x22\x3e\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x3c\
136 \x72\x65\x63\x74\x20\x78\x3d\x22\x31\x36\x39\x31\x22\x20\x79\x3d\
137 \x22\x30\x22\x20\x77\x69\x64\x74\x68\x3d\x22\x36\x30\x22\x20\x68\
138 \x65\x69\x67\x68\x74\x3d\x22\x36\x30\x22\x20\x73\x74\x79\x6c\x65\
139 \x3d\x22\x66\x69\x6c\x6c\x3a\x6e\x6f\x6e\x65\x3b\x22\x2f\x3e\x0a\
140 \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x3c\x67\x20\x74\
141 \x72\x61\x6e\x73\x66\x6f\x72\x6d\x3d\x22\x6d\x61\x74\x72\x69\x78\
142 \x28\x30\x2e\x39\x36\x30\x32\x34\x31\x2c\x30\x2c\x30\x2c\x30\x2e\
143 \x39\x36\x30\x32\x34\x31\x2c\x31\x34\x33\x31\x2e\x30\x31\x2c\x33\
144 \x2e\x31\x34\x37\x30\x31\x29\x22\x3e\x0a\x20\x20\x20\x20\x20\x20\
145 \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x3c\x70\x61\x74\x68\x20\
146 \x64\x3d\x22\x4d\x33\x30\x32\x2c\x31\x30\x2e\x38\x43\x33\x30\x37\
147 \x2e\x36\x38\x34\x2c\x30\x20\x33\x31\x39\x2e\x30\x35\x33\x2c\x30\
148 \x20\x33\x32\x34\x2e\x37\x33\x37\x2c\x35\x2e\x34\x43\x33\x33\x30\
149 \x2e\x34\x32\x31\x2c\x31\x30\x2e\x38\x20\x33\x33\x30\x2e\x34\x32\
150 \x31\x2c\x32\x31\x2e\x36\x20\x33\x32\x34\x2e\x37\x33\x37\x2c\x33\
151 \x32\x2e\x34\x43\x33\x32\x30\x2e\x37\x35\x38\x2c\x34\x30\x2e\x35\
152 \x20\x33\x31\x30\x2e\x35\x32\x36\x2c\x34\x38\x2e\x36\x20\x33\x30\
153 \x32\x2c\x35\x34\x43\x32\x39\x33\x2e\x34\x37\x34\x2c\x34\x38\x2e\
154 \x36\x20\x32\x38\x33\x2e\x32\x34\x32\x2c\x34\x30\x2e\x35\x20\x32\
155 \x37\x39\x2e\x32\x36\x33\x2c\x33\x32\x2e\x34\x43\x32\x37\x33\x2e\
156 \x35\x37\x39\x2c\x32\x31\x2e\x36\x20\x32\x37\x33\x2e\x35\x37\x39\
157 \x2c\x31\x30\x2e\x38\x20\x32\x37\x39\x2e\x32\x36\x33\x2c\x35\x2e\
158 \x34\x43\x32\x38\x34\x2e\x39\x34\x37\x2c\x30\x20\x32\x39\x36\x2e\
159 \x33\x31\x36\x2c\x30\x20\x33\x30\x32\x2c\x31\x30\x2e\x38\x5a\x22\
160 \x20\x73\x74\x79\x6c\x65\x3d\x22\x66\x69\x6c\x6c\x3a\x6e\x6f\x6e\
161 \x65\x3b\x73\x74\x72\x6f\x6b\x65\x3a\x62\x6c\x61\x63\x6b\x3b\x73\
162 \x74\x72\x6f\x6b\x65\x2d\x77\x69\x64\x74\x68\x3a\x32\x2e\x38\x32\
163 \x70\x78\x3b\x22\x2f\x3e\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\
164 \x20\x20\x20\x3c\x2f\x67\x3e\x0a\x20\x20\x20\x20\x20\x20\x20\x20\
165 \x3c\x2f\x67\x3e\x0a\x20\x20\x20\x20\x3c\x2f\x67\x3e\x0a\x3c\x2f\
166 \x73\x76\x67\x3e\x0a\
16711 \x00\x00\x02\xd7\
16812 \x89\
16913 \x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
21256 \x65\x5f\xe4\x65\x1e\x4a\x15\xd1\xa5\x23\x70\x04\x9e\x8f\xfc\x09\
21357 \x30\x00\xa0\x1c\x74\x67\x26\xea\x15\x76\x00\x00\x00\x00\x49\x45\
21458 \x4e\x44\xae\x42\x60\x82\
215 \x00\x00\x02\x68\
216 \x00\
217 \x00\x10\x25\x78\x9c\xed\x97\x5b\x6f\xd3\x30\x14\xc7\xdf\xf7\x29\
218 \x8c\x25\x24\x90\x52\x5f\x13\x3b\xce\x9a\x4d\xda\x85\x09\x69\xc0\
219 \x24\x36\x10\xbc\x85\xc4\x6b\xcd\xd2\x24\x4a\xb2\xb6\xfb\xf6\x9c\
220 \x64\xed\xb4\x6e\xd5\x40\x88\xf1\xb2\xb4\x55\xeb\x73\x72\x7c\x2e\
221 \x3f\xfb\xff\xd0\xf1\xfe\x72\x96\xa3\xb9\xad\x1b\x57\x16\x31\xe6\
222 \x84\x61\x64\x8b\xb4\xcc\x5c\x31\x89\xf1\xc5\xf9\xbb\x51\x88\x51\
223 \xd3\x26\x45\x96\xe4\x65\x61\x63\x5c\x94\x78\x7f\x6f\x67\xfc\xea\
224 \xe8\xd3\xe1\xf9\xb7\xb3\x63\xd4\xcc\x27\xe8\xec\xe2\xe0\xf4\xfd\
225 \x21\xc2\x23\x4a\xbf\xca\x43\x4a\x8f\xce\x8f\xd0\xe7\x2f\x27\x88\
226 \x13\x4e\xe9\xf1\x47\x8c\xf0\xb4\x6d\xab\x88\xd2\xc5\x62\x41\x16\
227 \x92\x94\xf5\x84\x9e\xd4\x49\x35\x75\x69\x43\x21\x90\x76\x81\xb0\
228 \x89\x42\x32\xce\x49\xd6\x66\x18\x4a\x74\x99\x17\x2e\x6b\xa7\xd0\
229 \x16\x63\xaf\x31\x9a\x5a\x37\x99\xb6\x6b\x6b\xee\xec\xe2\xa0\x5c\
230 \xc6\x98\x21\x86\x54\xf7\xc1\xf7\xe7\xe0\x18\xc1\x64\x45\x13\x6f\
231 \xa9\x2d\x18\x63\x5d\xad\x55\x48\xb4\xcc\x5d\x71\xb5\x2d\x90\x1b\
232 \x63\x68\xff\xb4\x0f\x8d\x9a\x2a\x49\x81\x41\x55\xdb\xc6\xd6\x73\
233 \xdb\x91\xb9\xc9\xc1\x71\xe9\xf2\x7c\x54\x5f\xe7\x36\xb2\x73\x5b\
234 \x94\x59\xb6\x9b\xe6\xae\xda\xf4\x34\x6d\x5d\x5e\xd9\x11\x24\xb3\
235 \x69\x52\x45\x75\x79\x5d\x6c\x38\x7f\x96\xae\xd8\xf4\xce\x5c\x6b\
236 \xeb\xdc\xc1\x4f\xc4\x49\xb0\x0b\x4c\x10\xbc\xc6\x13\xd4\xd6\x49\
237 \xd1\x5c\x96\xf5\x2c\xc6\xb3\xa4\xad\xdd\xf2\x0d\xf7\x18\xbc\xb9\
238 \x37\xf2\xb9\xf6\xd8\xdb\x55\xe8\x2a\xdc\x65\x31\x4e\xcb\x3c\xb7\
239 \x69\x0b\x70\xf0\x53\xdb\xb9\xd0\xfe\xe6\xfe\x3e\x47\x0d\x5b\x11\
240 \xa0\xe6\xca\x00\xd7\x1b\x60\x8e\xd7\x47\xd3\x61\x5f\x1f\x4c\xb7\
241 \xbe\x47\x24\x2a\xe0\xc6\xec\x62\xfa\x20\xd9\xb6\xfe\x19\x31\x7e\
242 \xe0\x4b\xd9\xf7\x71\x67\x18\x41\x94\x62\xdc\x13\x84\x2b\xa5\xcc\
243 \xc3\xb6\x9e\xc8\xa6\x82\x80\x73\xc8\x46\x18\xe3\x4a\xfa\x42\x78\
244 \xa3\x7e\x6d\x84\x66\x06\xdc\x5a\x8b\x00\x48\x71\x61\x0c\x31\xd2\
245 \x13\x21\x91\xa1\x0e\xb7\x15\xe8\x8b\x54\x49\x3b\x45\x40\xf1\x83\
246 \xd2\xd2\xd3\xa7\x2a\x10\xab\x6f\x0e\xbd\xf2\x53\xa5\x42\x22\xa0\
247 \x4f\xb8\xbb\x8c\xcb\x5b\xd3\x97\x9e\x14\xc4\x30\x30\xf5\xc6\x52\
248 \x7f\xdf\x02\xe9\xf6\xc4\xa3\x1f\x79\x92\x5e\xad\x8f\xbf\x07\x1c\
249 \xf9\xd5\xf2\x11\xc2\xbe\x27\x3a\xf9\xe7\x34\x24\x93\xc0\xc1\x13\
250 \x01\x11\x81\x0a\x5e\x3a\x0d\x61\x14\xd1\xa1\x27\x41\x7b\xdc\xff\
251 \x0b\x1a\xff\x77\xe0\xc7\x8e\x3f\xd7\x99\x52\x83\xce\x06\x9d\x0d\
252 \x3a\x7b\x6e\x9d\xc1\xa0\x4c\x19\xe5\x8d\x84\x26\x42\x85\x6a\x10\
253 \xda\x33\x5f\xad\x41\x68\x2f\x53\x68\x1a\xe6\xf7\x75\x30\x08\x6d\
254 \x10\xda\x20\xb4\xdf\x0d\xbc\xe1\xb8\x33\xfa\xc5\xb8\xfb\x97\xbc\
255 \xb7\xf3\x0b\x46\x33\xee\x37\
25659 \x00\x00\x05\x55\
25760 \x3c\
25861 \x3f\x78\x6d\x6c\x20\x76\x65\x72\x73\x69\x6f\x6e\x3d\x22\x31\x2e\
451254 \xf0\x09\xd0\xde\xc7\xe9\xb6\x11\x7f\x4b\x80\x25\xa0\xdc\xca\x39\
452255 \xc0\xff\x00\x27\xf2\xcd\xbe\x4f\x7b\xc5\xe3\x00\x00\x00\x00\x49\
453256 \x45\x4e\x44\xae\x42\x60\x82\
257 \x00\x00\x05\x69\
258 \x3c\
259 \x3f\x78\x6d\x6c\x20\x76\x65\x72\x73\x69\x6f\x6e\x3d\x22\x31\x2e\
260 \x30\x22\x20\x65\x6e\x63\x6f\x64\x69\x6e\x67\x3d\x22\x55\x54\x46\
261 \x2d\x38\x22\x20\x73\x74\x61\x6e\x64\x61\x6c\x6f\x6e\x65\x3d\x22\
262 \x6e\x6f\x22\x3f\x3e\x0a\x3c\x21\x44\x4f\x43\x54\x59\x50\x45\x20\
263 \x73\x76\x67\x20\x50\x55\x42\x4c\x49\x43\x20\x22\x2d\x2f\x2f\x57\
264 \x33\x43\x2f\x2f\x44\x54\x44\x20\x53\x56\x47\x20\x31\x2e\x31\x2f\
265 \x2f\x45\x4e\x22\x20\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\
266 \x2e\x77\x33\x2e\x6f\x72\x67\x2f\x47\x72\x61\x70\x68\x69\x63\x73\
267 \x2f\x53\x56\x47\x2f\x31\x2e\x31\x2f\x44\x54\x44\x2f\x73\x76\x67\
268 \x31\x31\x2e\x64\x74\x64\x22\x3e\x0a\x3c\x73\x76\x67\x20\x77\x69\
269 \x64\x74\x68\x3d\x22\x31\x30\x30\x25\x22\x20\x68\x65\x69\x67\x68\
270 \x74\x3d\x22\x31\x30\x30\x25\x22\x20\x76\x69\x65\x77\x42\x6f\x78\
271 \x3d\x22\x30\x20\x30\x20\x36\x30\x20\x36\x30\x22\x20\x76\x65\x72\
272 \x73\x69\x6f\x6e\x3d\x22\x31\x2e\x31\x22\x20\x78\x6d\x6c\x6e\x73\
273 \x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\
274 \x6f\x72\x67\x2f\x32\x30\x30\x30\x2f\x73\x76\x67\x22\x20\x78\x6d\
275 \x6c\x6e\x73\x3a\x78\x6c\x69\x6e\x6b\x3d\x22\x68\x74\x74\x70\x3a\
276 \x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\x72\x67\x2f\x31\x39\x39\
277 \x39\x2f\x78\x6c\x69\x6e\x6b\x22\x20\x78\x6d\x6c\x3a\x73\x70\x61\
278 \x63\x65\x3d\x22\x70\x72\x65\x73\x65\x72\x76\x65\x22\x20\x73\x74\
279 \x79\x6c\x65\x3d\x22\x66\x69\x6c\x6c\x2d\x72\x75\x6c\x65\x3a\x65\
280 \x76\x65\x6e\x6f\x64\x64\x3b\x63\x6c\x69\x70\x2d\x72\x75\x6c\x65\
281 \x3a\x65\x76\x65\x6e\x6f\x64\x64\x3b\x73\x74\x72\x6f\x6b\x65\x2d\
282 \x6c\x69\x6e\x65\x63\x61\x70\x3a\x72\x6f\x75\x6e\x64\x3b\x73\x74\
283 \x72\x6f\x6b\x65\x2d\x6c\x69\x6e\x65\x6a\x6f\x69\x6e\x3a\x72\x6f\
284 \x75\x6e\x64\x3b\x73\x74\x72\x6f\x6b\x65\x2d\x6d\x69\x74\x65\x72\
285 \x6c\x69\x6d\x69\x74\x3a\x31\x2e\x35\x3b\x22\x3e\x0a\x20\x20\x20\
286 \x20\x3c\x67\x20\x74\x72\x61\x6e\x73\x66\x6f\x72\x6d\x3d\x22\x6d\
287 \x61\x74\x72\x69\x78\x28\x31\x2c\x30\x2c\x30\x2c\x31\x2c\x2d\x32\
288 \x31\x30\x2c\x30\x29\x22\x3e\x0a\x20\x20\x20\x20\x20\x20\x20\x20\
289 \x3c\x67\x20\x69\x64\x3d\x22\x64\x65\x63\x6b\x22\x20\x74\x72\x61\
290 \x6e\x73\x66\x6f\x72\x6d\x3d\x22\x6d\x61\x74\x72\x69\x78\x28\x31\
291 \x2c\x30\x2c\x30\x2c\x31\x2c\x2d\x31\x34\x38\x31\x2c\x30\x29\x22\
292 \x3e\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x3c\x72\
293 \x65\x63\x74\x20\x78\x3d\x22\x31\x36\x39\x31\x22\x20\x79\x3d\x22\
294 \x30\x22\x20\x77\x69\x64\x74\x68\x3d\x22\x36\x30\x22\x20\x68\x65\
295 \x69\x67\x68\x74\x3d\x22\x36\x30\x22\x20\x73\x74\x79\x6c\x65\x3d\
296 \x22\x66\x69\x6c\x6c\x3a\x6e\x6f\x6e\x65\x3b\x22\x2f\x3e\x0a\x20\
297 \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x3c\x67\x20\x74\x72\
298 \x61\x6e\x73\x66\x6f\x72\x6d\x3d\x22\x6d\x61\x74\x72\x69\x78\x28\
299 \x31\x2e\x33\x34\x36\x35\x34\x2c\x30\x2e\x30\x30\x33\x33\x35\x39\
300 \x30\x34\x2c\x2d\x30\x2e\x30\x30\x33\x39\x36\x31\x30\x32\x2c\x31\
301 \x2e\x35\x38\x37\x38\x36\x2c\x38\x32\x39\x2e\x30\x31\x39\x2c\x2d\
302 \x33\x2e\x39\x30\x35\x38\x29\x22\x3e\x0a\x20\x20\x20\x20\x20\x20\
303 \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x3c\x70\x61\x74\x68\x20\
304 \x64\x3d\x22\x4d\x36\x37\x33\x2c\x37\x4c\x36\x35\x32\x2c\x37\x4c\
305 \x36\x35\x32\x2c\x31\x30\x2e\x39\x31\x4c\x36\x36\x38\x2e\x32\x30\
306 \x31\x2c\x31\x31\x2e\x30\x31\x33\x4c\x36\x36\x38\x2e\x32\x34\x33\
307 \x2c\x33\x32\x2e\x39\x30\x33\x4c\x36\x37\x33\x2c\x33\x32\x2e\x39\
308 \x30\x33\x4c\x36\x37\x33\x2c\x37\x5a\x22\x20\x73\x74\x79\x6c\x65\
309 \x3d\x22\x66\x69\x6c\x6c\x3a\x6e\x6f\x6e\x65\x3b\x73\x74\x72\x6f\
310 \x6b\x65\x3a\x62\x6c\x61\x63\x6b\x3b\x73\x74\x72\x6f\x6b\x65\x2d\
311 \x77\x69\x64\x74\x68\x3a\x31\x2e\x38\x34\x70\x78\x3b\x22\x2f\x3e\
312 \x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x3c\x2f\x67\
313 \x3e\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x3c\x67\
314 \x20\x74\x72\x61\x6e\x73\x66\x6f\x72\x6d\x3d\x22\x6d\x61\x74\x72\
315 \x69\x78\x28\x31\x2e\x33\x34\x36\x35\x34\x2c\x30\x2e\x30\x30\x33\
316 \x33\x35\x39\x30\x34\x2c\x2d\x30\x2e\x30\x30\x33\x39\x36\x31\x30\
317 \x32\x2c\x31\x2e\x35\x38\x37\x38\x36\x2c\x38\x33\x36\x2e\x30\x39\
318 \x36\x2c\x2d\x31\x30\x2e\x33\x34\x32\x29\x22\x3e\x0a\x20\x20\x20\
319 \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x3c\x70\x61\
320 \x74\x68\x20\x64\x3d\x22\x4d\x36\x37\x33\x2c\x37\x4c\x36\x35\x32\
321 \x2c\x37\x4c\x36\x35\x32\x2c\x31\x30\x2e\x39\x31\x4c\x36\x36\x38\
322 \x2e\x32\x30\x31\x2c\x31\x31\x2e\x30\x31\x33\x4c\x36\x36\x38\x2e\
323 \x32\x34\x33\x2c\x33\x32\x2e\x39\x30\x33\x4c\x36\x37\x33\x2c\x33\
324 \x32\x2e\x39\x30\x33\x4c\x36\x37\x33\x2c\x37\x5a\x22\x20\x73\x74\
325 \x79\x6c\x65\x3d\x22\x66\x69\x6c\x6c\x3a\x6e\x6f\x6e\x65\x3b\x73\
326 \x74\x72\x6f\x6b\x65\x3a\x62\x6c\x61\x63\x6b\x3b\x73\x74\x72\x6f\
327 \x6b\x65\x2d\x77\x69\x64\x74\x68\x3a\x31\x2e\x38\x34\x70\x78\x3b\
328 \x22\x2f\x3e\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\
329 \x3c\x2f\x67\x3e\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\
330 \x20\x3c\x67\x20\x74\x72\x61\x6e\x73\x66\x6f\x72\x6d\x3d\x22\x6d\
331 \x61\x74\x72\x69\x78\x28\x31\x2e\x33\x34\x36\x35\x34\x2c\x30\x2e\
332 \x30\x30\x33\x33\x35\x39\x30\x34\x2c\x2d\x30\x2e\x30\x30\x33\x39\
333 \x36\x31\x30\x32\x2c\x31\x2e\x35\x38\x37\x38\x36\x2c\x38\x32\x32\
334 \x2e\x35\x34\x31\x2c\x32\x2e\x35\x32\x30\x39\x31\x29\x22\x3e\x0a\
335 \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\
336 \x3c\x70\x61\x74\x68\x20\x64\x3d\x22\x4d\x36\x37\x33\x2c\x37\x4c\
337 \x36\x35\x32\x2c\x37\x4c\x36\x35\x32\x2c\x33\x32\x2e\x39\x30\x33\
338 \x4c\x36\x37\x33\x2c\x33\x32\x2e\x39\x30\x33\x4c\x36\x37\x33\x2c\
339 \x37\x5a\x22\x20\x73\x74\x79\x6c\x65\x3d\x22\x66\x69\x6c\x6c\x3a\
340 \x6e\x6f\x6e\x65\x3b\x73\x74\x72\x6f\x6b\x65\x3a\x62\x6c\x61\x63\
341 \x6b\x3b\x73\x74\x72\x6f\x6b\x65\x2d\x77\x69\x64\x74\x68\x3a\x31\
342 \x2e\x38\x34\x70\x78\x3b\x22\x2f\x3e\x0a\x20\x20\x20\x20\x20\x20\
343 \x20\x20\x20\x20\x20\x20\x3c\x2f\x67\x3e\x0a\x20\x20\x20\x20\x20\
344 \x20\x20\x20\x3c\x2f\x67\x3e\x0a\x20\x20\x20\x20\x3c\x2f\x67\x3e\
345 \x0a\x3c\x2f\x73\x76\x67\x3e\x0a\
346 \x00\x00\x02\x68\
347 \x00\
348 \x00\x10\x25\x78\x9c\xed\x97\x5b\x6f\xd3\x30\x14\xc7\xdf\xf7\x29\
349 \x8c\x25\x24\x90\x52\x5f\x13\x3b\xce\x9a\x4d\xda\x85\x09\x69\xc0\
350 \x24\x36\x10\xbc\x85\xc4\x6b\xcd\xd2\x24\x4a\xb2\xb6\xfb\xf6\x9c\
351 \x64\xed\xb4\x6e\xd5\x40\x88\xf1\xb2\xb4\x55\xeb\x73\x72\x7c\x2e\
352 \x3f\xfb\xff\xd0\xf1\xfe\x72\x96\xa3\xb9\xad\x1b\x57\x16\x31\xe6\
353 \x84\x61\x64\x8b\xb4\xcc\x5c\x31\x89\xf1\xc5\xf9\xbb\x51\x88\x51\
354 \xd3\x26\x45\x96\xe4\x65\x61\x63\x5c\x94\x78\x7f\x6f\x67\xfc\xea\
355 \xe8\xd3\xe1\xf9\xb7\xb3\x63\xd4\xcc\x27\xe8\xec\xe2\xe0\xf4\xfd\
356 \x21\xc2\x23\x4a\xbf\xca\x43\x4a\x8f\xce\x8f\xd0\xe7\x2f\x27\x88\
357 \x13\x4e\xe9\xf1\x47\x8c\xf0\xb4\x6d\xab\x88\xd2\xc5\x62\x41\x16\
358 \x92\x94\xf5\x84\x9e\xd4\x49\x35\x75\x69\x43\x21\x90\x76\x81\xb0\
359 \x89\x42\x32\xce\x49\xd6\x66\x18\x4a\x74\x99\x17\x2e\x6b\xa7\xd0\
360 \x16\x63\xaf\x31\x9a\x5a\x37\x99\xb6\x6b\x6b\xee\xec\xe2\xa0\x5c\
361 \xc6\x98\x21\x86\x54\xf7\xc1\xf7\xe7\xe0\x18\xc1\x64\x45\x13\x6f\
362 \xa9\x2d\x18\x63\x5d\xad\x55\x48\xb4\xcc\x5d\x71\xb5\x2d\x90\x1b\
363 \x63\x68\xff\xb4\x0f\x8d\x9a\x2a\x49\x81\x41\x55\xdb\xc6\xd6\x73\
364 \xdb\x91\xb9\xc9\xc1\x71\xe9\xf2\x7c\x54\x5f\xe7\x36\xb2\x73\x5b\
365 \x94\x59\xb6\x9b\xe6\xae\xda\xf4\x34\x6d\x5d\x5e\xd9\x11\x24\xb3\
366 \x69\x52\x45\x75\x79\x5d\x6c\x38\x7f\x96\xae\xd8\xf4\xce\x5c\x6b\
367 \xeb\xdc\xc1\x4f\xc4\x49\xb0\x0b\x4c\x10\xbc\xc6\x13\xd4\xd6\x49\
368 \xd1\x5c\x96\xf5\x2c\xc6\xb3\xa4\xad\xdd\xf2\x0d\xf7\x18\xbc\xb9\
369 \x37\xf2\xb9\xf6\xd8\xdb\x55\xe8\x2a\xdc\x65\x31\x4e\xcb\x3c\xb7\
370 \x69\x0b\x70\xf0\x53\xdb\xb9\xd0\xfe\xe6\xfe\x3e\x47\x0d\x5b\x11\
371 \xa0\xe6\xca\x00\xd7\x1b\x60\x8e\xd7\x47\xd3\x61\x5f\x1f\x4c\xb7\
372 \xbe\x47\x24\x2a\xe0\xc6\xec\x62\xfa\x20\xd9\xb6\xfe\x19\x31\x7e\
373 \xe0\x4b\xd9\xf7\x71\x67\x18\x41\x94\x62\xdc\x13\x84\x2b\xa5\xcc\
374 \xc3\xb6\x9e\xc8\xa6\x82\x80\x73\xc8\x46\x18\xe3\x4a\xfa\x42\x78\
375 \xa3\x7e\x6d\x84\x66\x06\xdc\x5a\x8b\x00\x48\x71\x61\x0c\x31\xd2\
376 \x13\x21\x91\xa1\x0e\xb7\x15\xe8\x8b\x54\x49\x3b\x45\x40\xf1\x83\
377 \xd2\xd2\xd3\xa7\x2a\x10\xab\x6f\x0e\xbd\xf2\x53\xa5\x42\x22\xa0\
378 \x4f\xb8\xbb\x8c\xcb\x5b\xd3\x97\x9e\x14\xc4\x30\x30\xf5\xc6\x52\
379 \x7f\xdf\x02\xe9\xf6\xc4\xa3\x1f\x79\x92\x5e\xad\x8f\xbf\x07\x1c\
380 \xf9\xd5\xf2\x11\xc2\xbe\x27\x3a\xf9\xe7\x34\x24\x93\xc0\xc1\x13\
381 \x01\x11\x81\x0a\x5e\x3a\x0d\x61\x14\xd1\xa1\x27\x41\x7b\xdc\xff\
382 \x0b\x1a\xff\x77\xe0\xc7\x8e\x3f\xd7\x99\x52\x83\xce\x06\x9d\x0d\
383 \x3a\x7b\x6e\x9d\xc1\xa0\x4c\x19\xe5\x8d\x84\x26\x42\x85\x6a\x10\
384 \xda\x33\x5f\xad\x41\x68\x2f\x53\x68\x1a\xe6\xf7\x75\x30\x08\x6d\
385 \x10\xda\x20\xb4\xdf\x0d\xbc\xe1\xb8\x33\xfa\xc5\xb8\xfb\x97\xbc\
386 \xb7\xf3\x0b\x46\x33\xee\x37\
387 \x00\x00\x04\x06\
388 \x3c\
389 \x3f\x78\x6d\x6c\x20\x76\x65\x72\x73\x69\x6f\x6e\x3d\x22\x31\x2e\
390 \x30\x22\x20\x65\x6e\x63\x6f\x64\x69\x6e\x67\x3d\x22\x55\x54\x46\
391 \x2d\x38\x22\x20\x73\x74\x61\x6e\x64\x61\x6c\x6f\x6e\x65\x3d\x22\
392 \x6e\x6f\x22\x3f\x3e\x0a\x3c\x21\x44\x4f\x43\x54\x59\x50\x45\x20\
393 \x73\x76\x67\x20\x50\x55\x42\x4c\x49\x43\x20\x22\x2d\x2f\x2f\x57\
394 \x33\x43\x2f\x2f\x44\x54\x44\x20\x53\x56\x47\x20\x31\x2e\x31\x2f\
395 \x2f\x45\x4e\x22\x20\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\
396 \x2e\x77\x33\x2e\x6f\x72\x67\x2f\x47\x72\x61\x70\x68\x69\x63\x73\
397 \x2f\x53\x56\x47\x2f\x31\x2e\x31\x2f\x44\x54\x44\x2f\x73\x76\x67\
398 \x31\x31\x2e\x64\x74\x64\x22\x3e\x0a\x3c\x73\x76\x67\x20\x77\x69\
399 \x64\x74\x68\x3d\x22\x31\x30\x30\x25\x22\x20\x68\x65\x69\x67\x68\
400 \x74\x3d\x22\x31\x30\x30\x25\x22\x20\x76\x69\x65\x77\x42\x6f\x78\
401 \x3d\x22\x30\x20\x30\x20\x36\x30\x20\x36\x30\x22\x20\x76\x65\x72\
402 \x73\x69\x6f\x6e\x3d\x22\x31\x2e\x31\x22\x20\x78\x6d\x6c\x6e\x73\
403 \x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\
404 \x6f\x72\x67\x2f\x32\x30\x30\x30\x2f\x73\x76\x67\x22\x20\x78\x6d\
405 \x6c\x6e\x73\x3a\x78\x6c\x69\x6e\x6b\x3d\x22\x68\x74\x74\x70\x3a\
406 \x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\x72\x67\x2f\x31\x39\x39\
407 \x39\x2f\x78\x6c\x69\x6e\x6b\x22\x20\x78\x6d\x6c\x3a\x73\x70\x61\
408 \x63\x65\x3d\x22\x70\x72\x65\x73\x65\x72\x76\x65\x22\x20\x73\x74\
409 \x79\x6c\x65\x3d\x22\x66\x69\x6c\x6c\x2d\x72\x75\x6c\x65\x3a\x65\
410 \x76\x65\x6e\x6f\x64\x64\x3b\x63\x6c\x69\x70\x2d\x72\x75\x6c\x65\
411 \x3a\x65\x76\x65\x6e\x6f\x64\x64\x3b\x73\x74\x72\x6f\x6b\x65\x2d\
412 \x6c\x69\x6e\x65\x63\x61\x70\x3a\x72\x6f\x75\x6e\x64\x3b\x73\x74\
413 \x72\x6f\x6b\x65\x2d\x6c\x69\x6e\x65\x6a\x6f\x69\x6e\x3a\x72\x6f\
414 \x75\x6e\x64\x3b\x73\x74\x72\x6f\x6b\x65\x2d\x6d\x69\x74\x65\x72\
415 \x6c\x69\x6d\x69\x74\x3a\x31\x2e\x35\x3b\x22\x3e\x0a\x20\x20\x20\
416 \x20\x3c\x67\x20\x74\x72\x61\x6e\x73\x66\x6f\x72\x6d\x3d\x22\x6d\
417 \x61\x74\x72\x69\x78\x28\x31\x2c\x30\x2c\x30\x2c\x31\x2c\x2d\x32\
418 \x38\x30\x2c\x30\x29\x22\x3e\x0a\x20\x20\x20\x20\x20\x20\x20\x20\
419 \x3c\x67\x20\x69\x64\x3d\x22\x68\x65\x61\x72\x74\x22\x20\x74\x72\
420 \x61\x6e\x73\x66\x6f\x72\x6d\x3d\x22\x6d\x61\x74\x72\x69\x78\x28\
421 \x31\x2c\x30\x2c\x30\x2c\x31\x2c\x2d\x31\x34\x31\x31\x2c\x30\x29\
422 \x22\x3e\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x3c\
423 \x72\x65\x63\x74\x20\x78\x3d\x22\x31\x36\x39\x31\x22\x20\x79\x3d\
424 \x22\x30\x22\x20\x77\x69\x64\x74\x68\x3d\x22\x36\x30\x22\x20\x68\
425 \x65\x69\x67\x68\x74\x3d\x22\x36\x30\x22\x20\x73\x74\x79\x6c\x65\
426 \x3d\x22\x66\x69\x6c\x6c\x3a\x6e\x6f\x6e\x65\x3b\x22\x2f\x3e\x0a\
427 \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x3c\x67\x20\x74\
428 \x72\x61\x6e\x73\x66\x6f\x72\x6d\x3d\x22\x6d\x61\x74\x72\x69\x78\
429 \x28\x30\x2e\x39\x36\x30\x32\x34\x31\x2c\x30\x2c\x30\x2c\x30\x2e\
430 \x39\x36\x30\x32\x34\x31\x2c\x31\x34\x33\x31\x2e\x30\x31\x2c\x33\
431 \x2e\x31\x34\x37\x30\x31\x29\x22\x3e\x0a\x20\x20\x20\x20\x20\x20\
432 \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x3c\x70\x61\x74\x68\x20\
433 \x64\x3d\x22\x4d\x33\x30\x32\x2c\x31\x30\x2e\x38\x43\x33\x30\x37\
434 \x2e\x36\x38\x34\x2c\x30\x20\x33\x31\x39\x2e\x30\x35\x33\x2c\x30\
435 \x20\x33\x32\x34\x2e\x37\x33\x37\x2c\x35\x2e\x34\x43\x33\x33\x30\
436 \x2e\x34\x32\x31\x2c\x31\x30\x2e\x38\x20\x33\x33\x30\x2e\x34\x32\
437 \x31\x2c\x32\x31\x2e\x36\x20\x33\x32\x34\x2e\x37\x33\x37\x2c\x33\
438 \x32\x2e\x34\x43\x33\x32\x30\x2e\x37\x35\x38\x2c\x34\x30\x2e\x35\
439 \x20\x33\x31\x30\x2e\x35\x32\x36\x2c\x34\x38\x2e\x36\x20\x33\x30\
440 \x32\x2c\x35\x34\x43\x32\x39\x33\x2e\x34\x37\x34\x2c\x34\x38\x2e\
441 \x36\x20\x32\x38\x33\x2e\x32\x34\x32\x2c\x34\x30\x2e\x35\x20\x32\
442 \x37\x39\x2e\x32\x36\x33\x2c\x33\x32\x2e\x34\x43\x32\x37\x33\x2e\
443 \x35\x37\x39\x2c\x32\x31\x2e\x36\x20\x32\x37\x33\x2e\x35\x37\x39\
444 \x2c\x31\x30\x2e\x38\x20\x32\x37\x39\x2e\x32\x36\x33\x2c\x35\x2e\
445 \x34\x43\x32\x38\x34\x2e\x39\x34\x37\x2c\x30\x20\x32\x39\x36\x2e\
446 \x33\x31\x36\x2c\x30\x20\x33\x30\x32\x2c\x31\x30\x2e\x38\x5a\x22\
447 \x20\x73\x74\x79\x6c\x65\x3d\x22\x66\x69\x6c\x6c\x3a\x6e\x6f\x6e\
448 \x65\x3b\x73\x74\x72\x6f\x6b\x65\x3a\x62\x6c\x61\x63\x6b\x3b\x73\
449 \x74\x72\x6f\x6b\x65\x2d\x77\x69\x64\x74\x68\x3a\x32\x2e\x38\x32\
450 \x70\x78\x3b\x22\x2f\x3e\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\
451 \x20\x20\x20\x3c\x2f\x67\x3e\x0a\x20\x20\x20\x20\x20\x20\x20\x20\
452 \x3c\x2f\x67\x3e\x0a\x20\x20\x20\x20\x3c\x2f\x67\x3e\x0a\x3c\x2f\
453 \x73\x76\x67\x3e\x0a\
454454 \x00\x00\x04\x30\
455455 \x3c\
456456 \x3f\x78\x6d\x6c\x20\x76\x65\x72\x73\x69\x6f\x6e\x3d\x22\x31\x2e\
527527 \x00\x6f\xa6\x53\
528528 \x00\x69\
529529 \x00\x63\x00\x6f\x00\x6e\x00\x73\
530 \x00\x08\
531 \x0b\x9e\x57\x87\
532 \x00\x64\
533 \x00\x65\x00\x63\x00\x6b\x00\x2e\x00\x73\x00\x76\x00\x67\
534 \x00\x09\
535 \x08\x97\x87\xa7\
536 \x00\x68\
537 \x00\x65\x00\x61\x00\x72\x00\x74\x00\x2e\x00\x73\x00\x76\x00\x67\
538530 \x00\x10\
539531 \x08\x12\xae\xa7\
540532 \x00\x6d\
541533 \x00\x65\x00\x64\x00\x69\x00\x61\x00\x2d\x00\x72\x00\x65\x00\x63\x00\x6f\x00\x72\x00\x64\x00\x2e\x00\x70\x00\x6e\x00\x67\
542 \x00\x0e\
543 \x04\x44\x35\x07\
544 \x00\x63\
545 \x00\x6f\x00\x6c\x00\x6c\x00\x65\x00\x63\x00\x74\x00\x69\x00\x6f\x00\x6e\x00\x2e\x00\x73\x00\x76\x00\x67\
546534 \x00\x0c\
547535 \x0e\xcd\x03\x47\
548536 \x00\x6e\
551539 \x05\x1c\x5a\x47\
552540 \x00\x61\
553541 \x00\x6e\x00\x6b\x00\x69\x00\x2e\x00\x70\x00\x6e\x00\x67\
542 \x00\x08\
543 \x0b\x9e\x57\x87\
544 \x00\x64\
545 \x00\x65\x00\x63\x00\x6b\x00\x2e\x00\x73\x00\x76\x00\x67\
546 \x00\x0e\
547 \x04\x44\x35\x07\
548 \x00\x63\
549 \x00\x6f\x00\x6c\x00\x6c\x00\x65\x00\x63\x00\x74\x00\x69\x00\x6f\x00\x6e\x00\x2e\x00\x73\x00\x76\x00\x67\
550 \x00\x09\
551 \x08\x97\x87\xa7\
552 \x00\x68\
553 \x00\x65\x00\x61\x00\x72\x00\x74\x00\x2e\x00\x73\x00\x76\x00\x67\
554554 \x00\x07\
555555 \x0a\x7a\x5a\x27\
556556 \x00\x74\
560560 qt_resource_struct_v1 = b"\
561561 \x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x01\
562562 \x00\x00\x00\x00\x00\x02\x00\x00\x00\x07\x00\x00\x00\x02\
563 \x00\x00\x00\x64\x00\x01\x00\x00\x00\x01\x00\x00\x0c\x52\
564 \x00\x00\x00\xa4\x00\x00\x00\x00\x00\x01\x00\x00\x14\x17\
565 \x00\x00\x00\x3e\x00\x00\x00\x00\x00\x01\x00\x00\x09\x77\
566 \x00\x00\x00\x26\x00\x00\x00\x00\x00\x01\x00\x00\x05\x6d\
563 \x00\x00\x00\x80\x00\x01\x00\x00\x00\x01\x00\x00\x14\x5d\
564 \x00\x00\x00\x54\x00\x00\x00\x00\x00\x01\x00\x00\x08\x34\
565 \x00\x00\x00\x10\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\
566 \x00\x00\x00\xa2\x00\x00\x00\x00\x00\x01\x00\x00\x16\xc9\
567567 \x00\x00\x00\xba\x00\x00\x00\x00\x00\x01\x00\x00\x1a\xd3\
568 \x00\x00\x00\x10\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\
569 \x00\x00\x00\x86\x00\x00\x00\x00\x00\x01\x00\x00\x0e\xbe\
568 \x00\x00\x00\x6a\x00\x00\x00\x00\x00\x01\x00\x00\x0e\xf0\
569 \x00\x00\x00\x36\x00\x00\x00\x00\x00\x01\x00\x00\x02\xdb\
570570 "
571571
572572 qt_resource_struct_v2 = b"\
574574 \x00\x00\x00\x00\x00\x00\x00\x00\
575575 \x00\x00\x00\x00\x00\x02\x00\x00\x00\x07\x00\x00\x00\x02\
576576 \x00\x00\x00\x00\x00\x00\x00\x00\
577 \x00\x00\x00\x64\x00\x01\x00\x00\x00\x01\x00\x00\x0c\x52\
577 \x00\x00\x00\x80\x00\x01\x00\x00\x00\x01\x00\x00\x14\x5d\
578578 \x00\x00\x01\x5e\x28\xa1\xc9\x08\
579 \x00\x00\x00\xa4\x00\x00\x00\x00\x00\x01\x00\x00\x14\x17\
579 \x00\x00\x00\x54\x00\x00\x00\x00\x00\x01\x00\x00\x08\x34\
580580 \x00\x00\x01\x37\x58\x6b\x1d\xa0\
581 \x00\x00\x00\x3e\x00\x00\x00\x00\x00\x01\x00\x00\x09\x77\
581 \x00\x00\x00\x10\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\
582582 \x00\x00\x01\x5d\xd9\x89\x57\x78\
583 \x00\x00\x00\x26\x00\x00\x00\x00\x00\x01\x00\x00\x05\x6d\
583 \x00\x00\x00\xa2\x00\x00\x00\x00\x00\x01\x00\x00\x16\xc9\
584584 \x00\x00\x01\x5d\xe3\xe5\x42\x18\
585585 \x00\x00\x00\xba\x00\x00\x00\x00\x00\x01\x00\x00\x1a\xd3\
586586 \x00\x00\x01\x5d\xe3\xe5\x42\x18\
587 \x00\x00\x00\x10\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\
587 \x00\x00\x00\x6a\x00\x00\x00\x00\x00\x01\x00\x00\x0e\xf0\
588588 \x00\x00\x01\x5d\xe3\xe5\x42\x18\
589 \x00\x00\x00\x86\x00\x00\x00\x00\x00\x01\x00\x00\x0e\xbe\
589 \x00\x00\x00\x36\x00\x00\x00\x00\x00\x01\x00\x00\x02\xdb\
590590 \x00\x00\x01\x5d\xe4\x02\xb9\x10\
591591 "
592592
11
22 # Form implementation generated from reading ui file 'designer/modelopts.ui'
33 #
4 # Created by: PyQt5 UI code generator 5.6
4 # Created by: PyQt5 UI code generator 5.9
55 #
66 # WARNING! All changes made in this file will be lost!
77
2020 self.tab = QtWidgets.QWidget()
2121 self.tab.setObjectName("tab")
2222 self.verticalLayout = QtWidgets.QVBoxLayout(self.tab)
23 self.verticalLayout.setContentsMargins(0, 0, 0, 0)
2423 self.verticalLayout.setObjectName("verticalLayout")
2524 self.latexsvg = QtWidgets.QCheckBox(self.tab)
2625 self.latexsvg.setObjectName("latexsvg")
4039 self.latexFooter.setObjectName("latexFooter")
4140 self.verticalLayout.addWidget(self.latexFooter)
4241 self.qtabwidget.addTab(self.tab, "")
43 self.tab_2 = QtWidgets.QWidget()
44 self.tab_2.setObjectName("tab_2")
45 self.verticalLayout_3 = QtWidgets.QVBoxLayout(self.tab_2)
46 self.verticalLayout_3.setContentsMargins(0, 0, 0, 0)
47 self.verticalLayout_3.setObjectName("verticalLayout_3")
48 self.newStyleWhitespace = QtWidgets.QCheckBox(self.tab_2)
49 self.newStyleWhitespace.setObjectName("newStyleWhitespace")
50 self.verticalLayout_3.addWidget(self.newStyleWhitespace)
51 spacerItem = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
52 self.verticalLayout_3.addItem(spacerItem)
53 self.qtabwidget.addTab(self.tab_2, "")
5442 self.verticalLayout_2.addWidget(self.qtabwidget)
5543 self.buttonBox = QtWidgets.QDialogButtonBox(Dialog)
5644 self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
7361 self.label_6.setText(_("Header"))
7462 self.label_7.setText(_("Footer"))
7563 self.qtabwidget.setTabText(self.qtabwidget.indexOf(self.tab), _("LaTeX"))
76 self.newStyleWhitespace.setText(_("New style whitespace handling (EXPERIMENTAL)"))
77 self.qtabwidget.setTabText(self.qtabwidget.indexOf(self.tab_2), _("General"))
7864
113113
114114 # catch /_anki references and rewrite them to web export folder
115115 def _redirectWebExports(self, path):
116 targetPath = os.path.join(os.getcwd(), "_anki")
116 targetPath = os.path.join(os.getcwd(), "_anki", "")
117117 if path.startswith(targetPath):
118 newPath = os.path.join(_exportFolder, path[len(targetPath)+1:])
118 newPath = os.path.join(_exportFolder, path[len(targetPath):])
119119 return newPath
120120 return path
121121
109109 frm.latexsvg.setChecked(self.model.get("latexsvg", False))
110110 frm.latexHeader.setText(self.model['latexPre'])
111111 frm.latexFooter.setText(self.model['latexPost'])
112 frm.newStyleWhitespace.setChecked(self.model.get("prewrap", False))
113112 d.setWindowTitle(_("Options for %s") % self.model['name'])
114113 frm.buttonBox.helpRequested.connect(lambda: openHelp("latex"))
115114 restoreGeom(d, "modelopts")
118117 self.model['latexsvg'] = frm.latexsvg.isChecked()
119118 self.model['latexPre'] = str(frm.latexHeader.toPlainText())
120119 self.model['latexPost'] = str(frm.latexFooter.toPlainText())
121 self.model['prewrap'] = frm.newStyleWhitespace.isChecked()
122120
123121 def saveModel(self):
124122 self.mm.save(self.model)
111111 self._win.setCancelButton(None)
112112 self._win.setAutoClose(False)
113113 self._win.setAutoReset(False)
114 self._win.setWindowModality(Qt.ApplicationModal)
114115 self._win.setMinimumWidth(300)
115116 # we need to manually manage minimum time to show, as qt gets confused
116117 # by the db handler
158158 if c.isEmpty():
159159 q = _("""\
160160 The front of this card is empty. Please run Tools>Empty Cards.""")
161 a = ""
162161 else:
163162 q = c.q()
164 a = c.a()
165163 if self.autoplay(c):
166164 playFromText(q)
167165 # render & update bottom
207205 c = self.card
208206 a = c.a()
209207 # play audio?
208 clearAudioQueue()
210209 if self.autoplay(c):
211210 playFromText(a)
212211 a = self._mungeQA(a)
385384 # compare in NFC form so accents appear correct
386385 given = ucd.normalize("NFC", given)
387386 correct = ucd.normalize("NFC", correct)
388 try:
389 s = difflib.SequenceMatcher(None, given, correct, autojunk=False)
390 except:
391 # autojunk was added in python 2.7.1
392 s = difflib.SequenceMatcher(None, given, correct)
387 s = difflib.SequenceMatcher(None, given, correct, autojunk=False)
393388 givenElems = []
394389 correctElems = []
395390 givenPoint = 0
447442 self.web.evalWithCallback("typeans ? typeans.value : null", self._onTypedAnswer)
448443
449444 def _onTypedAnswer(self, val):
450 self.typedAnswer = val
445 self.typedAnswer = val or ""
451446 self._showAnswer()
452447
453448 # Bottom bar
534529 return l + ((2, _("Hard")), (3, _("Good")), (4, _("Easy")))
535530
536531 def _answerButtons(self):
537 times = []
538532 default = self._defaultEase()
539533 def but(i, label):
540534 if i == default:
598592 m = QMenu(self.mw)
599593 self._addMenuItems(m, opts)
600594
601 runHook("Reviewer.contextMenuEvent",self,m)
595 runHook("Reviewer.contextMenuEvent", self, m)
602596 m.exec_(QCursor.pos())
603597
604598 def _addMenuItems(self, m, rows):
1313 self.deck = self.parent.deck
1414 self.dialog = aqt.forms.taglimit.Ui_Dialog()
1515 self.dialog.setupUi(self)
16 s = QShortcut(QKeySequence("ctrl+d"), self.dialog.activeList, context=Qt.WidgetShortcut)
17 s.activated.connect(self.dialog.activeList.clearSelection)
18 s = QShortcut(QKeySequence("ctrl+d"), self.dialog.inactiveList, context=Qt.WidgetShortcut)
19 s.activated.connect(self.dialog.inactiveList.clearSelection)
1620 self.rebuildTagList()
1721 restoreGeom(self, "tagLimit")
1822 self.exec_()
9898 QShortcut(key, self,
9999 context=Qt.WidgetWithChildrenShortcut,
100100 activated=fn)
101 QShortcut(QKeySequence("ctrl+shift+v"), self,
102 context=Qt.WidgetWithChildrenShortcut, activated=self.onPaste)
101103
102104 self.focusProxy().installEventFilter(self)
103105
6363 </item>
6464 </layout>
6565 </widget>
66 <widget class="QWidget" name="tab_2">
67 <attribute name="title">
68 <string>General</string>
69 </attribute>
70 <layout class="QVBoxLayout" name="verticalLayout_3">
71 <item>
72 <widget class="QCheckBox" name="newStyleWhitespace">
73 <property name="text">
74 <string>New style whitespace handling (EXPERIMENTAL)</string>
75 </property>
76 </widget>
77 </item>
78 <item>
79 <spacer name="verticalSpacer">
80 <property name="orientation">
81 <enum>Qt::Vertical</enum>
82 </property>
83 <property name="sizeHint" stdset="0">
84 <size>
85 <width>20</width>
86 <height>40</height>
87 </size>
88 </property>
89 </spacer>
90 </item>
91 </layout>
92 </widget>
9366 </widget>
9467 </item>
9568 <item>
6363 border-bottom: 3px solid #000;
6464 }
6565
66 .prewrap {
67 white-space: pre-wrap;
68 }
69
7066 #fields {
7167 margin-top: 35px;
7268 }
00 var currentField = null;
11 var changeTimer = null;
22 var dropTarget = null;
3 var prewrapMode = false;
43
54 String.prototype.format = function () {
65 var args = arguments;
2625 currentField.blur();
2726 return;
2827 }
29 // catch enter key in prewrap mode
30 if (window.event.which === 13 && prewrapMode) {
31 window.event.preventDefault();
32 insertNewline();
33 return;
34 }
3528 // shift+tab goes to previous field
3629 if (navigator.platform === "MacIntel" &&
3730 window.event.which === 9 && window.event.shiftKey) {
31 window.event.preventDefault();
3832 focusPrevious();
3933 return;
4034 }
262256 return true;
263257 }
264258
265 function setFields(fields, prewrap) {
259 function setFields(fields) {
266260 var txt = "";
267261 for (var i = 0; i < fields.length; i++) {
268262 var n = fields[i][0];
280274 }
281275 $("#fields").html("<table cellpadding=0 width=100%>" + txt + "</table>");
282276 maybeDisableButtons();
283 prewrapMode = prewrap;
284 if (prewrap) {
285 $(".field").addClass("prewrap");
286 }
287277 }
288278
289279 function setBackgrounds(cols) {
309299 $("#dupes").hide();
310300 }
311301
312 var pasteHTML = function (html, internal) {
313 if (!internal) {
314 html = filterHTML(html);
315 }
302 var pasteHTML = function (html, internal, allowedTags) {
303 html = filterHTML(html, internal, allowedTags);
316304 setFormat("inserthtml", html);
317305 };
318306
319 var filterHTML = function (html) {
307 var filterHTML = function (html, internal, extendedMode) {
320308 // wrap it in <top> as we aren't allowed to change top level elements
321309 var top = $.parseHTML("<ankitop>" + html + "</ankitop>")[0];
322 filterNode(top);
310 if (internal) {
311 filterInternalNode(top);
312 } else {
313 filterNode(top, extendedMode);
314 }
323315 var outHtml = top.innerHTML;
324316 //console.log(`input html: ${html}`);
325317 //console.log(`outpt html: ${outHtml}`);
326318 return outHtml;
327319 };
328320
329 var allowedTags = {};
330
331 var TAGS_WITHOUT_ATTRS = ["H1", "H2", "H3", "P", "DIV", "BR", "LI", "UL",
332 "OL", "B", "I", "U", "BLOCKQUOTE", "CODE", "EM",
333 "STRONG", "PRE", "SUB", "SUP", "TABLE", "DD", "DT", "DL"];
334 for (var i = 0; i < TAGS_WITHOUT_ATTRS.length; i++) {
335 allowedTags[TAGS_WITHOUT_ATTRS[i]] = {"attrs": []};
336 }
337
338 allowedTags["A"] = {"attrs": ["HREF"]};
339 allowedTags["TR"] = {"attrs": ["ROWSPAN"]};
340 allowedTags["TD"] = {"attrs": ["COLSPAN", "ROWSPAN"]};
341 allowedTags["TH"] = {"attrs": ["COLSPAN", "ROWSPAN"]};
342 allowedTags["IMG"] = {"attrs": ["SRC"]};
343
344 var blockRegex = /^(address|blockquote|br|center|div|dl|h[1-6]|hr|ol|p|pre|table|ul|dd|dt|li|tbody|td|tfoot|th|thead|tr)$/i;
345 function isBlockLevel(n) {
346 return blockRegex.test(n.nodeName);
347 }
348
349 function isInlineElement(n) {
350 return n && !isBlockLevel(n);
351 }
352
353 function convertDivToNewline(node, isParagraph) {
354 var html = node.innerHTML;
355 if (isInlineElement(node.previousSibling) && html) {
356 html = "\n" + html;
357 }
358 if (isInlineElement(node.nextSibling)) {
359 html += "\n";
360 }
361 if (isParagraph) {
362 html += "\n";
363 }
364 node.outerHTML = html;
365 }
366
367 var filterNode = function (node) {
321 var allowedTagsBasic = {};
322 var allowedTagsExtended = {};
323
324 var TAGS_WITHOUT_ATTRS = ["P", "DIV", "BR",
325 "B", "I", "U", "EM", "STRONG", "SUB", "SUP"];
326 var i;
327 for (i = 0; i < TAGS_WITHOUT_ATTRS.length; i++) {
328 allowedTagsBasic[TAGS_WITHOUT_ATTRS[i]] = {"attrs": []};
329 }
330
331 TAGS_WITHOUT_ATTRS = ["H1", "H2", "H3", "LI", "UL", "BLOCKQUOTE", "CODE",
332 "PRE", "TABLE", "DD", "DT", "DL"];
333 for (i = 0; i < TAGS_WITHOUT_ATTRS.length; i++) {
334 allowedTagsExtended[TAGS_WITHOUT_ATTRS[i]] = {"attrs": []};
335 }
336
337 allowedTagsBasic["IMG"] = {"attrs": ["SRC"]};
338
339 allowedTagsExtended["A"] = {"attrs": ["HREF"]};
340 allowedTagsExtended["TR"] = {"attrs": ["ROWSPAN"]};
341 allowedTagsExtended["TD"] = {"attrs": ["COLSPAN", "ROWSPAN"]};
342 allowedTagsExtended["TH"] = {"attrs": ["COLSPAN", "ROWSPAN"]};
343
344 // add basic tags to extended
345 Object.assign(allowedTagsExtended, allowedTagsBasic);
346
347 // filtering from another field
348 var filterInternalNode = function (node) {
349 if (node.tagName === "SPAN") {
350 node.style.removeProperty("background-color");
351 node.style.removeProperty("font-size");
352 node.style.removeProperty("font-family");
353 }
354 // recurse
355 for (i = 0; i < node.childNodes.length; i++) {
356 filterInternalNode(node.childNodes[i]);
357 }
358 };
359
360 // filtering from external sources
361 var filterNode = function (node, extendedMode) {
368362 // text node?
369363 if (node.nodeType === 3) {
370 if (prewrapMode) {
371 // collapse standard whitespace
372 var val = node.nodeValue.replace(/^[ \r\n\t]+$/g, " ");
373
374 // non-breaking spaces can be represented as normal spaces
375 val = val.replace(/&nbsp;|\u00a0/g, " ");
376
377 node.nodeValue = val;
378 }
379364 return;
380365 }
381366
388373 nodes.push(node.childNodes[i]);
389374 }
390375 for (i = 0; i < nodes.length; i++) {
391 filterNode(nodes[i]);
376 filterNode(nodes[i], extendedMode);
392377 }
393378
394379 if (node.tagName === "ANKITOP") {
395380 return;
396381 }
397382
398 var tag = allowedTags[node.tagName];
383 var tag;
384 if (extendedMode) {
385 tag = allowedTagsExtended[node.tagName];
386 } else {
387 tag = allowedTagsBasic[node.tagName];
388 }
399389 if (!tag) {
400390 if (!node.innerHTML) {
401391 node.parentNode.removeChild(node);
402392 } else {
403393 node.outerHTML = node.innerHTML;
404394 }
405 } else if (prewrapMode && node.tagName === "BR") {
406 node.outerHTML = "\n";
407 } else if (prewrapMode && node.tagName === "DIV") {
408 convertBlockToNewline(node, false);
409 } else if (prewrapMode && node.tagName === "P") {
410 convertBlockToNewline(node, true);
411395 } else {
412396 // allowed, filter out attributes
413397 var toRemove = [];
00 var ankiPlatform = "desktop";
11 var typeans;
2 var _updatingQA = false;
23
34 var qFade = 100;
45 var aFade = 0;
1314 }
1415
1516 function _updateQA(html, fadeTime, onupdate, onshown) {
17 // if a request to update q/a comes in before the previous content
18 // has been loaded, wait a while and try again
19 if (_updatingQA) {
20 setTimeout(function () { _updateQA(html, fadeTime, onupdate, onshown) }, 50);
21 return;
22 }
23
24 _updatingQA = true;
25
1626 onUpdateHook = [onupdate];
1727 onShownHook = [onshown];
1828
3747 MathJax.Hub.Queue(function () {
3848 qa.fadeTo(fadeTime, 1, function () {
3949 _runHook(onShownHook);
50 _updatingQA = false;
4051 });
4152 });
4253 });