mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
...
This commit is contained in:
parent
dfcadabf14
commit
3163853540
@ -685,5 +685,13 @@ class ViewerPlugin(Plugin): # {{{
|
||||
evaljs(js)
|
||||
'''
|
||||
pass
|
||||
|
||||
def run_javascript(self, evaljs):
|
||||
'''
|
||||
This method is called every time a document has finished laoding. Use
|
||||
it in the same way as load_javascript().
|
||||
'''
|
||||
pass
|
||||
|
||||
# }}}
|
||||
|
||||
|
@ -91,7 +91,8 @@ class Document(QWebPage): # {{{
|
||||
|
||||
# Fonts
|
||||
load_builtin_fonts()
|
||||
for pl in all_viewer_plugins():
|
||||
self.all_viewer_plugins = tuple(all_viewer_plugins())
|
||||
for pl in self.all_viewer_plugins:
|
||||
pl.load_fonts()
|
||||
self.set_font_settings()
|
||||
|
||||
@ -175,7 +176,7 @@ class Document(QWebPage): # {{{
|
||||
evaljs = self.mainFrame().evaluateJavaScript
|
||||
self.loaded_lang = self.js_loader(evaljs, self.current_language,
|
||||
self.hyphenate_default_lang)
|
||||
for pl in all_viewer_plugins():
|
||||
for pl in self.all_viewer_plugins:
|
||||
pl.load_javascript(evaljs)
|
||||
|
||||
@pyqtSignature("")
|
||||
@ -213,6 +214,9 @@ class Document(QWebPage): # {{{
|
||||
if self.in_paged_mode:
|
||||
self.switch_to_paged_mode()
|
||||
self.read_anchor_positions(use_cache=False)
|
||||
evaljs = self.mainFrame().evaluateJavaScript
|
||||
for pl in self.all_viewer_plugins:
|
||||
pl.run_javascript(evaljs)
|
||||
self.first_load = False
|
||||
|
||||
def colors(self):
|
||||
|
Loading…
x
Reference in New Issue
Block a user