diff --git a/src/pyj/read_book/overlay.pyj b/src/pyj/read_book/overlay.pyj index f4f853c06b..00684900b1 100644 --- a/src/pyj/read_book/overlay.pyj +++ b/src/pyj/read_book/overlay.pyj @@ -311,10 +311,18 @@ class MainOverlay: # {{{ if full_screen_actions.length: actions_div.appendChild(E.ul(*full_screen_actions)) + highlight_action = ac(_('Highlight'), _('Highlight text in the book'), + def(): self.overlay.hide(), self.overlay.view.initiate_create_annotation();, 'highlight') + if runtime.is_standalone_viewer: actions_div.appendChild(E.ul( ac(_('Lookup/search word'), _('Lookup or search for the currently selected word'), def(): self.overlay.hide(), ui_operations.toggle_lookup();, 'library') + , + highlight_action, + ac(_('Browse highlights'), _('Browse all highlights'), + def(): self.overlay.hide(), ui_operations.toggle_highlights();, 'image') + , )) copy_actions = E.ul() if self.overlay.view.currently_showing.selected_text: @@ -343,6 +351,8 @@ class MainOverlay: # {{{ ac(_('Quit'), _('Close the viewer'), def(): self.overlay.hide(), ui_operations.quit();, 'remove'), )) + else: + actions_div.appendChild(E.ul(highlight_action)) container.appendChild(set_css(E.div(class_=MAIN_OVERLAY_TS_CLASS, # top section onclick=def (evt):evt.stopPropagation();, diff --git a/src/pyj/read_book/view.pyj b/src/pyj/read_book/view.pyj index f9fb298560..1fe818517f 100644 --- a/src/pyj/read_book/view.pyj +++ b/src/pyj/read_book/view.pyj @@ -433,7 +433,7 @@ class View: elif data.name is 'toggle_highlights': ui_operations.toggle_highlights() elif data.name is 'create_annotation': - self.iframe_wrapper.send_message('create_annotation') + self.initiate_create_annotation() elif data.name is 'new_bookmark': ui_operations.new_bookmark() elif data.name is 'toggle_inspector': @@ -1193,6 +1193,9 @@ class View: else: self.show_name(sr.file_name, initial_position={'type':'search_result', 'search_result':sr, 'replace_history':True}) + def initiate_create_annotation(self): + self.iframe_wrapper.send_message('create_annotation') + def highlight_action(self, uuid, which): if self.create_annotation.is_visible: return