Exemple #1
0
 def __init__(self, parent, editor):
     AnkiWebView.__init__(self)
     self.editor = editor
     self.strip = self.editor.mw.pm.profile['stripHTML']
     self.setAcceptDrops(True)
     self._markInternal = False
     clip = self.editor.mw.app.clipboard()
     clip.dataChanged.connect(self._onClipboardChange)
Exemple #2
0
 def __init__(self, parent, editor):
     AnkiWebView.__init__(self)
     self.editor = editor
     self.strip = self.editor.mw.pm.profile["stripHTML"]
     self.setAcceptDrops(True)
     self._markInternal = False
     clip = self.editor.mw.app.clipboard()
     clip.dataChanged.connect(self._onClipboardChange)
Exemple #3
0
 def __init__(self, parent: QWidget, editor: Editor) -> None:
     AnkiWebView.__init__(self, title="editor")
     self.editor = editor
     self.setAcceptDrops(True)
     self._markInternal = False
     clip = self.editor.mw.app.clipboard()
     qconnect(clip.dataChanged, self._onClipboardChange)
     gui_hooks.editor_web_view_did_init(self)
Exemple #4
0
 def __init__(self, parent, editor):
     AnkiWebView.__init__(self, title="editor")
     self.editor = editor
     self.strip = self.editor.mw.pm.profile["stripHTML"]
     self.setAcceptDrops(True)
     self._markInternal = False
     clip = self.editor.mw.app.clipboard()
     qconnect(clip.dataChanged, self._onClipboardChange)
     gui_hooks.editor_web_view_did_init(self)
Exemple #5
0
    def __init__(
        self,
        parent,
        template_fmts,
        callback,
    ):
        AnkiWebView.__init__(self, parent=parent, title="minifier")
        self.set_bridge_command(self.bridge_cmd, parent)

        self.template_fmts = template_fmts
        self.callback = callback
Exemple #6
0
    def __init__(self, parent):
        AnkiWebView.__init__(self, title = "Extractor")

        self.parent = parent
        addon_id = ADDON_NAME

        self.set_bridge_command(self._on_bridge_cmd, self)
        self.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding)

        self.stdHtml(f"""<html><body id="htmlcontent"></body></html>""",
        css = [f"../_addons/{addon_id}/web/style.css"],
        js = [f"../_addons/{addon_id}/web/content.js",
              f"../_addons/{addon_id}/web/tinymce/tinymce.min.js"])

        self.eval(f"""var absolute_base_url = "http://127.0.0.1:{mw.mediaServer.getPort()}/";""")
Exemple #7
0
 def __init__(self, parent, editor):
     AnkiWebView.__init__(self)
     self.editor = editor
     self.errtxt = _("An error occured while opening %s")
     self.strip = self.editor.mw.pm.profile['stripHTML']
Exemple #8
0
 def __init__(self, parent, editor):
     AnkiWebView.__init__(self)
     self.editor = editor
     self.strip = self.editor.mw.pm.profile['stripHTML']
     self.setAcceptDrops(True)
Exemple #9
0
 def __init__(self, parent, editor):
     AnkiWebView.__init__(self)
     self.editor = editor
     self.strip = self.editor.mw.pm.profile['stripHTML']
Exemple #10
0
 def __init__(self, parent, editor):
     AnkiWebView.__init__(self, canFocus=True)
     self.editor = editor
     self.strip = self.editor.mw.pm.profile['stripHTML']
Exemple #11
0
 def __init__(self, parent, editor):
     AnkiWebView.__init__(self)
     self.editor = editor
     self.errtxt = _("An error occured while opening %s")
     self.strip = self.editor.mw.pm.profile['stripHTML']
Exemple #12
0
 def __init__(self, parent, editor):
     AnkiWebView.__init__(self)
     self.editor = editor
     self.errtxt = _("An error occured while opening %s")
     self.strip = True
Exemple #13
0
 def __init__(self, parent, editor):
     AnkiWebView.__init__(self, canFocus=True)
     self.editor = editor
     self.strip = self.editor.mw.pm.profile["stripHTML"]
Exemple #14
0
 def __init__(self, sidebar):
     AnkiWebView.__init__(self, None)
     self.sidebar = sidebar
Exemple #15
0
 def __init__(self, parent, editor):
     AnkiWebView.__init__(self, parent)
     self.editor = editor
     self.errtxt = _("An error occured while opening %s")
     self.strip = self.editor.mw.config["stripHTML"]