Сворачивание/разворачивание секций на форме авторинга

Issue #219 closed
Oleg Sychev repo owner created an issue

Originally reported on Google Code with ID 219

Осуществляется треугольником перед названием секции.

Почему-то оно не работает - надо нацепить на них соответствующие обработчики яваскрипта.

Сворачивание крайне полезно: представьте что юзер плохо понимает дерево, и хочет увидеть
регекс и граф рядом например, не скролля через огромное дерево...

Reported by oasychev on 2013-09-03 21:10:23

Comments (10)

  1. Valeriy Streltsov
    Есть скрипт /lib/form/yui/shortforms/shortforms.js, который не доходит до формы редактирования.
    Он отвечает как раз за разворачивания.
    
    Скрипты до формы авторинга не доходят, проверено через requires->js простенького скрипта
    с алертом (до формы редактирования вопроса все доходит нормально).
    

    Reported by vostreltsov on 2013-09-05 16:34:33

  2. Former user Account Deleted
    и yui и jquery при вызове метода .html() вырезают скрипты. Можно подкючить скрипты вручную,
    но это придется делать через eval.
    

    Reported by TOPT.iiiii on 2013-09-05 16:38:37

  3. Former user Account Deleted
    скрипты в диалог теперь загружаются корректно. Однако, с сервера приходит html без скриптов
    с созданием стрелочек (вообще без head, body, footer).
    
    <form autocomplete="off" action="http://localhost/moodle25/question/type/preg/authoring_tools/ast_preg_form.php"
    method="post" accept-charset="utf-8" id="mform1" class="mform">
        <div style="display: none;"><input name="mform_isexpanded_id_regex_input_header" type="hidden"
    value="1" />
    <input name="mform_isexpanded_id_regex_tree_header" type="hidden" value="1" />
    <input name="mform_isexpanded_id_regex_graph_header" type="hidden" value="1" />
    <input name="mform_isexpanded_id_regex_description_header" type="hidden" value="1"
    />
    <input name="mform_isexpanded_id_regex_match_header" type="hidden" value="1" />
    <input name="sesskey" type="hidden" value="GHw8xrpVrI" />
    <input name="_qf__qtype_preg_authoring_tool_form" type="hidden" value="1" />
    </div>
    
        <div class="collapsible-actions"><span class="collapseexpand">Expand all</span></div>
    <div align="center"><h2>Authoring tools</h2></div>
        <fieldset class="clearfix collapsible"  id="id_regex_input_header" aria-live="polite">
            <legend class="ftoggler">Regular expression<span class="helptooltip"><a href="http://localhost/moodle25/help.php?component=qtype_preg&identifier=regex_edit_header&lang=en"
    title="Help with Regex input" aria-haspopup="true" target="_blank"><img src="http://localhost/moodle25/theme/image.php/standard/core/1378400470/help"
    alt="Help with Regex input" class="iconhelp" /></a></span></legend>
            <div class="fcontainer clearfix">
    
            <div id="fitem_id_regex_text" class="fitem fitem_ftextarea"><div class="fitemtitle"><label
    for="id_regex_text">Enter your regex here: </label></div><div class="felement ftextarea"><textarea
    cols="100" rows="1" name="regex_text" id="id_regex_text"></textarea></div></div>
            <div id="fgroup_id_input_regex_line" class="fitem fitem_fgroup"><div class="fitemtitle"><div
    class="fgrouplabel"><label> </label></div></div><fieldset class="felement fgroup"><input
    name="regex_update" value="Update" type="submit" id="id_regex_update" /> <input name="regex_save"
    value="Save" type="button" id="id_regex_save" /> <input name="regex_cancel" value="Cancel"
    type="button" id="id_regex_cancel" /> <input name="regex_show_selection" value="Show
    selection" type="button" id="id_regex_show_selection" /></fieldset></div>
            <div id="fgroup_id_charset_process_radioset" class="fitem fitem_fgroup"><div class="fitemtitle"><div
    class="fgrouplabel"><label>Display mode for complex character classes: </label></div></div><fieldset
    class="felement fgroup"><span><input name="authoring_tools_charset_process" value="userinscription"
    type="radio" checked="checked" id="id_authoring_tools_charset_process_userinscription"
    /><label for="id_authoring_tools_charset_process_userinscription">as written in regular
    expressions</label></span> <span><input name="authoring_tools_charset_process" value="flags"
    type="radio" id="id_authoring_tools_charset_process_flags" /><label for="id_authoring_tools_charset_process_flags">real
    meaning (unified format)</label></span></fieldset></div>
            </div></fieldset>
        <fieldset class="clearfix collapsible"  id="id_regex_tree_header" aria-live="polite">
            <legend class="ftoggler">Syntax tree<span class="helptooltip"><a href="http://localhost/moodle25/help.php?component=qtype_preg&identifier=syntax_tree_tool&lang=en"
    title="Help with Syntax tree" aria-haspopup="true" target="_blank"><img src="http://localhost/moodle25/theme/image.php/standard/core/1378400470/help"
    alt="Help with Syntax tree" class="iconhelp" /></a></span></legend>
            <div class="fcontainer clearfix">
    
            <div id="fgroup_id_tree_orientation_radioset" class="fitem fitem_fgroup"><div class="fitemtitle"><div
    class="fgrouplabel"><label> </label></div></div><fieldset class="felement fgroup"><span><input
    name="authoring_tools_tree_orientation" value="vertical" type="radio" checked="checked"
    id="id_authoring_tools_tree_orientation_vertical" /><label for="id_authoring_tools_tree_orientation_vertical">vertical</label></span>
    <span><input name="authoring_tools_tree_orientation" value="horizontal" type="radio"
    id="id_authoring_tools_tree_orientation_horizontal" /><label for="id_authoring_tools_tree_orientation_horizontal">horizontal</label></span></fieldset></div><div
    id="tree_map" ></div></br><div style="max-height:400px;position:relative;overflow:auto
    !important;width:100%;max-width:100%" id="tree_hnd"><div id="tree_err"></div><div style="width:10px"><img
    src="" id="tree_img" usemap="#qtype_preg_graph" alt="Building the tree..." /></div></div></br>
            </div></fieldset>
        <fieldset class="clearfix collapsible"  id="id_regex_graph_header" aria-live="polite">
            <legend class="ftoggler">Explaining graph<span class="helptooltip"><a href="http://localhost/moodle25/help.php?component=qtype_preg&identifier=explaining_graph_tool&lang=en"
    title="Help with Explaining graph" aria-haspopup="true" target="_blank"><img src="http://localhost/moodle25/theme/image.php/standard/core/1378400470/help"
    alt="Help with Explaining graph" class="iconhelp" /></a></span></legend>
            <div class="fcontainer clearfix">
            <div style="max-height:400px;position:relative;overflow:auto !important;width:100%;max-width:100%"
    id="graph_hnd"><div id="graph_err"></div><div style="width:10px"><img src="" id="graph_img"
    alt="Building the graph..." /></div></div></br>
            </div></fieldset>
        <fieldset class="clearfix collapsible"  id="id_regex_description_header" aria-live="polite">
            <legend class="ftoggler">Description<span class="helptooltip"><a href="http://localhost/moodle25/help.php?component=qtype_preg&identifier=description_tool&lang=en"
    title="Help with Description" aria-haspopup="true" target="_blank"><img src="http://localhost/moodle25/theme/image.php/standard/core/1378400470/help"
    alt="Help with Description" class="iconhelp" /></a></span></legend>
            <div class="fcontainer clearfix">
            <div id="description_handler"></div>
            </div></fieldset>
        <fieldset class="clearfix collapsible"  id="id_regex_match_header" aria-live="polite">
            <legend class="ftoggler">Regular expression testing<span class="helptooltip"><a href="http://localhost/moodle25/help.php?component=qtype_preg&identifier=regex_match_header&lang=en"
    title="Help with Regular expression testing" aria-haspopup="true" target="_blank"><img
    src="http://localhost/moodle25/theme/image.php/standard/core/1378400470/help" alt="Help
    with Regular expression testing" class="iconhelp" /></a></span></legend>
            <div class="fcontainer clearfix">
    
            <div id="fitem_id_regex_match_text" class="fitem fitem_ftextarea"><div class="fitemtitle"><label
    for="id_regex_match_text">Input strings to match (one per line) </label></div><div
    class="felement ftextarea"><div style="width:100%; display:inline-block"><textarea
    cols="50" name="regex_match_text" id="id_regex_match_text"></textarea> <div style="display:inline-block"
    id="id_test_regex" class="que"></div></div></div></div>
            <div id="fitem_id_regex_check_strings" class="fitem fitem_fbutton"><div class="fitemtitle"><label
    for="id_regex_check_strings"> </label></div><div class="felement fbutton"><input name="regex_check_strings"
    value="Check the string(s)" type="button" id="id_regex_check_strings" /></div></div>
            </div></fieldset>
    </form>
    

    Reported by TOPT.iiiii on 2013-09-05 17:34:09

  4. Oleg Sychev reporter
    Для примера страницы, выдающей форму см question/category.php - сравните ее с ast_preg_form.php
    - там многого не хватает...
    

    Reported by oasychev on 2013-09-05 17:40:12

  5. Valeriy Streltsov
    ast_preg_form.php пофиксил, shortforms.js приходит. Но алерты говорят, что скрипт выполняется
    на форме редактирования вопроса, второй раз. Есть ли способ исправить это? Там есть
    PAGE->set_url, но ведь они оба совпадают по идее...
    

    Reported by vostreltsov on 2013-09-05 19:18:12 - Status changed: InProgress

  6. Oleg Sychev reporter
    Ну это надо смотреть исходник shortforms.js - что именно он перебирает. Не факт, что
    он использует $PAGE. И уж врядли url - не перезапрашивает же он еще раз....
    

    Reported by oasychev on 2013-09-05 19:24:51

  7. Valeriy Streltsov
    Вроде бы пофиксил.
    

    Reported by vostreltsov on 2013-09-06 19:27:24 - Status changed: Fixed

  8. Oleg Sychev reporter
    Фикс оказался как всегда несложным - надо было задать ид-шник формы, отличный от формы
    самого вопроса...
    
    Раз уж это issue создало надписи в подвале, давайте в нем их и пофиксим...
    

    Reported by oasychev on 2013-09-06 19:46:48 - Status changed: InProgress

  9. Oleg Sychev reporter
    Подвал я пофиксил, закрываю...
    

    Reported by oasychev on 2013-09-06 19:56:47 - Status changed: Done

  10. Log in to comment