From 088c933958b1f05c9797be1502d5e017ad09de7b Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 2 Jul 2018 17:11:52 +0530 Subject: [PATCH] More work on in-server conversion UI --- src/pyj/book_list/conversion_widgets.pyj | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/src/pyj/book_list/conversion_widgets.pyj b/src/pyj/book_list/conversion_widgets.pyj index ee4a189784..cfe469b404 100644 --- a/src/pyj/book_list/conversion_widgets.pyj +++ b/src/pyj/book_list/conversion_widgets.pyj @@ -63,7 +63,6 @@ def create_simple_widget(name, text, tooltip, input_widget_, getter, setter, suf return container.lastChild.firstChild input_widget = straight_input_widget - input_widget(label).addEventListener('change', on_change.bind(None, name)) ops = { 'get': def (container): @@ -85,6 +84,9 @@ def create_simple_widget(name, text, tooltip, input_widget_, getter, setter, suf ops.set(label, get_option_value(name)) if is_option_disabled(name): ops.set_disabled(label, True) + input_widget(label).addEventListener('change', on_change.bind(None, name)) + if listeners[name]: + window.setTimeout(on_change.bind(None, name), 0) return label # }}} @@ -194,6 +196,23 @@ def look_and_feel(container): g.appendChild(choices('change_justification', _('Text &justification:'), {'original': _('Original'), 'left': _('Left align'), 'justify': _('Justify text')} )) + g.appendChild(checkbox('smarten_punctuation', _('Smarten &punctuation'))) + g.appendChild(checkbox('unsmarten_punctuation', _('&UnSmarten punctuation'))) + g.appendChild(checkbox('asciiize', _('&Transliterate unicode characters to ASCII'))) + + subhead(_('Lay&out')) + add_listener('remove_paragraph_spacing', def (name): + disabled = get('remove_paragraph_spacing') + set_disabled('remove_paragraph_spacing_indent_size', not disabled) + ) + g = E.div(class_='simple-group') + container.appendChild(g) + indent = '↳\xa0' + g.appendChild(checkbox('remove_paragraph_spacing', _('Remove &spacing between paragraphs'))) + g.appendChild(float_spin('remove_paragraph_spacing_indent_size', indent + _('I&ndent size:'), min=-0.1, unit='em')) + g.appendChild(checkbox('insert_blank_line', _('Insert &blank line between paragraphs'))) + g.appendChild(float_spin('insert_blank_line_size', indent + _('&Line size:'), unit='em')) + g.appendChild(checkbox('linearize_tables', _('&Linearize tables'))) # }}}