# vim:fileencoding=utf-8 # License: GPL v3 Copyright: 2023, Kovid Goyal from __python__ import bound_methods, hash_literals from elementmaker import E from gettext import gettext as _ from ajax import ajax from book_list.comments_editor import ( create_comments_editor, destroy_editor, focus_comments_editor, get_comments_html, set_comments_html ) from book_list.details_list import sandbox_css from book_list.globals import book_whose_metadata_is_being_edited from book_list.library_data import book_metadata from book_list.router import back, home, show_note from book_list.top_bar import add_button, create_top_bar from book_list.ui import set_panel_handler from modals import ajax_send_progress_dialog, error_dialog from utils import parse_url_params, safe_set_inner_html, sandboxed_html def message_from_iframe(ev): c = document.getElementById(current_container_id) if c and c.lastChild: iframe = c.querySelector('iframe') if iframe and ev.source is iframe.contentWindow: if ev.data.key: ev.data.from_iframe = True close_action = get_close_action()[0] onkeydown(current_container_id, close_action, ev.data) def make_iframe(html): html += '''