From 52b92bc96785af66b263e59480ec658b213df326 Mon Sep 17 00:00:00 2001 From: Jake Probst Date: Sun, 11 Mar 2012 05:48:57 -0700 Subject: [PATCH 1/3] fixed webkit adding html into cards --- aqt/editor.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aqt/editor.py b/aqt/editor.py index 3ffa64bec..f9a929ff8 100644 --- a/aqt/editor.py +++ b/aqt/editor.py @@ -397,6 +397,9 @@ class Editor(object): def mungeHTML(self, txt): if txt == "
": txt = "" + fa = re.findall('((.*))', txt) + if fa: + txt = txt.replace(fa[0][0], fa[0][1]) return txt # Setting/unsetting the current note From 51146ccd51be92fddbce74437cfa71e8a763207f Mon Sep 17 00:00:00 2001 From: Jake Probst Date: Sun, 11 Mar 2012 05:50:20 -0700 Subject: [PATCH 2/3] deck and tag section of add card dialog takes up less space --- aqt/editor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aqt/editor.py b/aqt/editor.py index f9a929ff8..bf23e6ba1 100644 --- a/aqt/editor.py +++ b/aqt/editor.py @@ -240,7 +240,7 @@ class Editor(object): self.web = EditorWebView(self.widget, self) self.web.allowDrops = True self.web.setBridge(self.bridge) - self.outerLayout.addWidget(self.web) + self.outerLayout.addWidget(self.web, 1) # pick up the window colour p = self.web.palette() p.setBrush(QPalette.Base, Qt.transparent) From 8c424e5e9562ae18b89af4ad8b513843e952738c Mon Sep 17 00:00:00 2001 From: Jake Probst Date: Sun, 11 Mar 2012 06:24:31 -0700 Subject: [PATCH 3/3] not terrible autoscrolling in add card window --- aqt/editor.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/aqt/editor.py b/aqt/editor.py index bf23e6ba1..a00c46af0 100644 --- a/aqt/editor.py +++ b/aqt/editor.py @@ -97,7 +97,11 @@ function onFocus(elem) { } while (obj = obj.offsetParent); return cur; } - window.scroll(0,pos(elem)-15); + var y = pos(elem); + if ((window.pageYOffset+window.innerHeight) < (y+elem.offsetHeight)) + window.scroll(0,y+elem.offsetHeight-window.innerHeight); + else if (window.pageYOffset > y) + window.scroll(0, y-15); } // restore cursor