diff --git a/src/pyj/read_book/globals.pyj b/src/pyj/read_book/globals.pyj index eed6045926..0f43d38ba7 100644 --- a/src/pyj/read_book/globals.pyj +++ b/src/pyj/read_book/globals.pyj @@ -78,7 +78,7 @@ ui_operations = { 'forward_gesture': None, 'update_color_scheme': None, 'update_font_size': None, - 'goto_bookpos': None, + 'goto_cfi': None, 'delete_book': None, 'focus_iframe': None, 'toggle_toc': None, diff --git a/src/pyj/read_book/goto.pyj b/src/pyj/read_book/goto.pyj index 2b07b7b328..c13b8029d4 100644 --- a/src/pyj/read_book/goto.pyj +++ b/src/pyj/read_book/goto.pyj @@ -87,7 +87,7 @@ def create_location_overlay(current_position_data, overlay, container): def goto_loc(): src = document.querySelector(f'#{container_id} [name=newloc]') if src.value: - if ui_operations.goto_bookpos(src.value): + if ui_operations.goto_cfi(src.value): overlay.hide() else: error_dialog(_('No such location'), _( diff --git a/src/pyj/read_book/overlay.pyj b/src/pyj/read_book/overlay.pyj index b1ab0d76e4..ec0c69927b 100644 --- a/src/pyj/read_book/overlay.pyj +++ b/src/pyj/read_book/overlay.pyj @@ -167,7 +167,7 @@ class SyncBook: # {{{ if ans is not None: cfi = ans.cfi if cfi: - self.overlay.view.goto_bookpos(cfi) + self.overlay.view.goto_cfi(cfi) # }}} diff --git a/src/pyj/read_book/ui.pyj b/src/pyj/read_book/ui.pyj index 65eaa8a18a..181dd27157 100644 --- a/src/pyj/read_book/ui.pyj +++ b/src/pyj/read_book/ui.pyj @@ -65,7 +65,7 @@ class ReadUI: ui_operations.forward_gesture = self.forward_gesture.bind(self) ui_operations.update_color_scheme = self.update_color_scheme.bind(self) ui_operations.update_font_size = self.update_font_size.bind(self) - ui_operations.goto_bookpos = self.goto_bookpos.bind(self) + ui_operations.goto_cfi = self.goto_cfi.bind(self) ui_operations.goto_frac = self.goto_frac.bind(self) ui_operations.delete_book = self.delete_book.bind(self) ui_operations.focus_iframe = self.focus_iframe.bind(self) @@ -160,8 +160,8 @@ class ReadUI: def update_font_size(self): self.view.update_font_size() - def goto_bookpos(self, bookpos): - return self.view.goto_bookpos(bookpos) + def goto_cfi(self, bookpos): + return self.view.goto_cfi(bookpos) def goto_frac(self, frac): return self.view.goto_frac(frac) @@ -494,7 +494,7 @@ class ReadUI: window.scrollTo(0, 0) # Ensure we are at the top of the window if same: if current_state.bookpos is not current_query.bookpos and current_query.bookpos: - self.view.goto_bookpos(current_query.bookpos) + self.view.goto_cfi(current_query.bookpos) else: self.load_book(current_query.library_id, int(current_query.book_id), current_query.fmt, library_data.metadata[current_query.book_id]) diff --git a/src/pyj/read_book/view.pyj b/src/pyj/read_book/view.pyj index ecc3edd4c3..2022cb92c3 100644 --- a/src/pyj/read_book/view.pyj +++ b/src/pyj/read_book/view.pyj @@ -697,11 +697,11 @@ class View: def on_scroll_to_anchor(self, data): self.show_name(data.name, initial_position={'type':'anchor', 'anchor':data.frag, 'replace_history':False}) - def goto_bookpos(self, bookpos): + def goto_cfi(self, bookpos): cfiname, internal_cfi = self.parse_cfi(bookpos, self.book) if cfiname and internal_cfi: # replace_history has to be true here otherwise forward does not - # work after back, as back uses goto_bookpos + # work after back, as back uses goto_cfi pos = {'replace_history': True} name = cfiname pos.type, pos.cfi = 'cfi', internal_cfi diff --git a/src/pyj/viewer-main.pyj b/src/pyj/viewer-main.pyj index 5add96e56a..16e920eded 100644 --- a/src/pyj/viewer-main.pyj +++ b/src/pyj/viewer-main.pyj @@ -129,7 +129,7 @@ def on_pop_state(): if view and view.currently_showing: data = parse_url_params() if data.bookpos and data.bookpos.startswith('epubcfi(/'): - view.goto_bookpos(data.bookpos) + view.goto_cfi(data.bookpos) def show_error(title, msg, details): @@ -243,7 +243,7 @@ def goto_toc_node(node_id): @from_python def goto_cfi(cfi): - view.goto_bookpos(cfi) + view.goto_cfi(cfi) @from_python @@ -304,8 +304,8 @@ if window is window.top: view.update_font_size() ui_operations.focus_iframe = def(): view.focus_iframe() - ui_operations.goto_bookpos = def(cfi): - return view.goto_bookpos(cfi) + ui_operations.goto_cfi = def(cfi): + return view.goto_cfi(cfi) ui_operations.goto_frac = def(frac): return view.goto_frac(frac) ui_operations.toggle_toc = def():