def demo_html_empty(window_info): trigger( window_info, "html.empty", to=BROADCAST, selector=".empty", )
def demo_html_remove(window_info): trigger( window_info, "html.remove", to=BROADCAST, selector=".remove", )
def demo_html_focus(window_info): trigger( window_info, "html.focus", to=BROADCAST, selector=".focus", )
def demo_html_add_class(window_info): trigger( window_info, "html.add_class", to=BROADCAST, selector=".add_class", class_name="text-success", )
def demo_html_after(window_info): trigger( window_info, "html.after", to=BROADCAST, selector=".after", content='<li class="list-group-item"><i>New text</i></li>', )
def demo_html_replace_with(window_info): trigger( window_info, "html.replace_with", to=BROADCAST, selector=".replace_with .original", content="<span> <i>New text</i> </span>", )
def demo_html_content(window_info): trigger( window_info, "html.content", to=BROADCAST, selector=".content", content="<span> <i>New text</i> </span>", )
def demo_html_download_file(window_info): trigger( window_info, "html.download_file", to=BROADCAST, url="%s%s" % (settings.STATIC_URL, "image.png"), filename="django.png", )
def demo_html_text(window_info): trigger( window_info, "html.text", to=BROADCAST, selector=".text .original", content="<span>New text (HTML tags are not interpreted)</span>", )
def demo_html_remove_attr(window_info): trigger( window_info, "html.remove_attr", to=BROADCAST, selector=".remove_attr input", attr_name="checked", )
def demo_html_remove_class(window_info): trigger( window_info, "html.remove_class", to=BROADCAST, selector=".remove_class", class_name="text-danger", )
def demo_html_add_attribute(window_info): trigger( window_info, "html.add_attribute", to=BROADCAST, selector=".add_attribute input", attr_name="checked", attr_value="checked", )
def demo_html_forms_set(window_info): trigger( window_info, "html.forms.set", to=BROADCAST, selector=".forms-set", values=[ {"name": "textarea", "value": "A textarea value"}, {"name": "radio", "value": "3"}, {"name": "checkbox", "value": ["3"]}, {"name": "single-checkbox", "value": True}, {"name": "no-single-checkbox", "value": False}, {"name": "simple", "value": "lemon"}, {"name": "groups", "value": "potato"}, {"name": "multi", "value": ["lemon", "eggplant"]}, ], )
def demo_html_boolean_attribute(window_info): trigger( window_info, "html.boolean_attribute", to=BROADCAST, selector=".boolean_attribute .true input", name="checked", value=True, ) trigger( window_info, "html.boolean_attribute", to=BROADCAST, selector=".boolean_attribute .false input", name="checked", value=False, )