mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix #4220 (E-Book Viewer position in book navigation is broken)
This commit is contained in:
parent
2042052a92
commit
6e25583bc0
@ -10,7 +10,7 @@ from calibre.web.feeds.news import BasicNewsRecipe
|
|||||||
|
|
||||||
class FinancialTimes(BasicNewsRecipe):
|
class FinancialTimes(BasicNewsRecipe):
|
||||||
title = u'Financial Times'
|
title = u'Financial Times'
|
||||||
__author__ = 'Darko Miletic'
|
__author__ = 'Darko Miletic and Sujata Raman'
|
||||||
description = 'Financial world news'
|
description = 'Financial world news'
|
||||||
oldest_article = 2
|
oldest_article = 2
|
||||||
language = 'en'
|
language = 'en'
|
||||||
@ -21,9 +21,9 @@ class FinancialTimes(BasicNewsRecipe):
|
|||||||
needs_subscription = True
|
needs_subscription = True
|
||||||
simultaneous_downloads= 1
|
simultaneous_downloads= 1
|
||||||
delay = 1
|
delay = 1
|
||||||
|
|
||||||
LOGIN = 'https://registration.ft.com/registration/barrier/login'
|
LOGIN = 'https://registration.ft.com/registration/barrier/login'
|
||||||
|
|
||||||
def get_browser(self):
|
def get_browser(self):
|
||||||
br = BasicNewsRecipe.get_browser()
|
br = BasicNewsRecipe.get_browser()
|
||||||
if self.username is not None and self.password is not None:
|
if self.username is not None and self.password is not None:
|
||||||
@ -33,7 +33,7 @@ class FinancialTimes(BasicNewsRecipe):
|
|||||||
br['password'] = self.password
|
br['password'] = self.password
|
||||||
br.submit()
|
br.submit()
|
||||||
return br
|
return br
|
||||||
|
|
||||||
keep_only_tags = [ dict(name='div', attrs={'id':'cont'}) ]
|
keep_only_tags = [ dict(name='div', attrs={'id':'cont'}) ]
|
||||||
remove_tags_after = dict(name='p', attrs={'class':'copyright'})
|
remove_tags_after = dict(name='p', attrs={'class':'copyright'})
|
||||||
remove_tags = [
|
remove_tags = [
|
||||||
@ -48,12 +48,12 @@ class FinancialTimes(BasicNewsRecipe):
|
|||||||
a{color:#003399;}
|
a{color:#003399;}
|
||||||
.container{font-size:x-small;}
|
.container{font-size:x-small;}
|
||||||
h3{font-size:x-small;color:#003399;}
|
h3{font-size:x-small;color:#003399;}
|
||||||
'''
|
'''
|
||||||
feeds = [
|
feeds = [
|
||||||
(u'UK' , u'http://www.ft.com/rss/home/uk' )
|
(u'UK' , u'http://www.ft.com/rss/home/uk' )
|
||||||
,(u'US' , u'http://www.ft.com/rss/home/us' )
|
,(u'US' , u'http://www.ft.com/rss/home/us' )
|
||||||
,(u'Asia' , u'http://www.ft.com/rss/home/asia' )
|
,(u'Asia' , u'http://www.ft.com/rss/home/asia' )
|
||||||
,(u'Middle East', u'http://www.ft.com/rss/home/middleeast')
|
,(u'Middle East', u'http://www.ft.com/rss/home/middleeast')
|
||||||
]
|
]
|
||||||
|
|
||||||
def preprocess_html(self, soup):
|
def preprocess_html(self, soup):
|
||||||
|
@ -228,7 +228,7 @@ class EbookViewer(MainWindow, Ui_EbookViewer):
|
|||||||
self.connect(self.action_bookmark, SIGNAL('triggered(bool)'), self.bookmark)
|
self.connect(self.action_bookmark, SIGNAL('triggered(bool)'), self.bookmark)
|
||||||
self.connect(self.action_forward, SIGNAL('triggered(bool)'), self.forward)
|
self.connect(self.action_forward, SIGNAL('triggered(bool)'), self.forward)
|
||||||
self.connect(self.action_preferences, SIGNAL('triggered(bool)'), lambda x: self.view.config(self))
|
self.connect(self.action_preferences, SIGNAL('triggered(bool)'), lambda x: self.view.config(self))
|
||||||
self.connect(self.pos, SIGNAL('valueChanged(double)'), self.goto_page)
|
self.pos.editingFinished.connect(self.goto_page_num)
|
||||||
self.connect(self.vertical_scrollbar, SIGNAL('valueChanged(int)'),
|
self.connect(self.vertical_scrollbar, SIGNAL('valueChanged(int)'),
|
||||||
lambda x: self.goto_page(x/100.))
|
lambda x: self.goto_page(x/100.))
|
||||||
self.connect(self.search, SIGNAL('search(PyQt_PyObject, PyQt_PyObject)'), self.find)
|
self.connect(self.search, SIGNAL('search(PyQt_PyObject, PyQt_PyObject)'), self.find)
|
||||||
@ -319,6 +319,9 @@ class EbookViewer(MainWindow, Ui_EbookViewer):
|
|||||||
if pos is not None:
|
if pos is not None:
|
||||||
self.goto_page(pos)
|
self.goto_page(pos)
|
||||||
|
|
||||||
|
def goto_page_num(self):
|
||||||
|
num = self.pos.value()
|
||||||
|
self.goto_page(num)
|
||||||
|
|
||||||
def forward(self, x):
|
def forward(self, x):
|
||||||
pos = self.history.forward()
|
pos = self.history.forward()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user