Пример #1
0
def demo_html_empty(window_info):
    trigger(
        window_info,
        "html.empty",
        to=BROADCAST,
        selector=".empty",
    )
Пример #2
0
def demo_html_remove(window_info):
    trigger(
        window_info,
        "html.remove",
        to=BROADCAST,
        selector=".remove",
    )
Пример #3
0
def demo_html_focus(window_info):
    trigger(
        window_info,
        "html.focus",
        to=BROADCAST,
        selector=".focus",
    )
Пример #4
0
def demo_html_add_class(window_info):
    trigger(
        window_info,
        "html.add_class",
        to=BROADCAST,
        selector=".add_class",
        class_name="text-success",
    )
Пример #5
0
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>',
    )
Пример #6
0
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>",
    )
Пример #7
0
def demo_html_content(window_info):
    trigger(
        window_info,
        "html.content",
        to=BROADCAST,
        selector=".content",
        content="<span> <i>New text</i> </span>",
    )
Пример #8
0
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",
    )
Пример #9
0
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>",
    )
Пример #10
0
def demo_html_remove_attr(window_info):
    trigger(
        window_info,
        "html.remove_attr",
        to=BROADCAST,
        selector=".remove_attr input",
        attr_name="checked",
    )
Пример #11
0
def demo_html_remove_class(window_info):
    trigger(
        window_info,
        "html.remove_class",
        to=BROADCAST,
        selector=".remove_class",
        class_name="text-danger",
    )
Пример #12
0
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",
    )
Пример #13
0
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"]},
        ],
    )
Пример #14
0
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,
    )