VirtualBox

Changeset 65160 in vbox


Ignore:
Timestamp:
Jan 5, 2017 5:13:38 PM (8 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
112663
Message:

TestManager: Added clear button.

Location:
trunk/src/VBox/ValidationKit/testmanager
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/ValidationKit/testmanager/htdocs/css/common.css

    r65154 r65160  
    329329}
    330330
    331 .tm-sidebar-size-link {
    332     float:          right;
    333 }
    334 
    335 .tm-side-filter-union-input {
    336     float:          right;
    337 }
    338 
    339331/* The following is for the element of / not element of checkbox, supplying text and hiding the actual box. */
    340332input.tm-side-filter-union-input {
     
    371363
    372364/* Filters: */
     365.tm-side-filter-title-buttons {
     366    float:          right;
     367}
     368.tm-side-filter-title-buttons input {
     369    font-size:      0.6em;
     370}
     371.tm-side-filter-union-input {
     372    float:          right;
     373}
     374
    373375#side-filters p:first-child {
    374376    margin-top:     0.5em;
  • trunk/src/VBox/ValidationKit/testmanager/htdocs/js/common.js

    r65145 r65160  
    353353
    354354
     355
     356/**
     357 * Clears one input element.
     358 *
     359 * @param   oInput      The input to clear.
     360 */
     361function resetInput(oInput)
     362{
     363    switch (oInput.type)
     364    {
     365        case 'checkbox':
     366        case 'radio':
     367            oInput.checked = false;
     368            break;
     369
     370        case 'text':
     371            oInput.value = 0;
     372            break;
     373    }
     374}
     375
     376
     377/**
     378 * Clears a form.
     379 *
     380 * @param   sIdForm     The ID of the form
     381 */
     382function clearForm(sIdForm)
     383{
     384    var oForm = document.getElementById(sIdForm);
     385    if (oForm)
     386    {
     387        var aoInputs = oForm.getElementsByTagName('INPUT');
     388        var i;
     389        for (i = 0; i < aoInputs.length; i++)
     390            resetInput(aoInputs[i])
     391
     392        /* HTML5 allows inputs outside <form>, so scan the document. */
     393        aoInputs = document.getElementsByTagName('INPUT');
     394        for (i = 0; i < aoInputs.length; i++)
     395            if (aoInputs.hasOwnProperty("form"))
     396                if (aoInputs.form == sIdForm)
     397                    resetInput(aoInputs[i])
     398    }
     399
     400    return true;
     401}
     402
     403
    355404/** @name Collapsible / Expandable items
    356405 * @{
     
    456505    var i;
    457506    for (i = 0; i < aoToggleLink.length; i++)
    458         if (aoToggleLink[i].textContent.indexOf('\u00bb') >= 0 || aoToggleLink[i].textContent.indexOf('\u00ab') >= 0)
     507        if (   aoToggleLink[i].textContent.indexOf('\u00bb') >= 0
     508            || aoToggleLink[i].textContent.indexOf('\u00ab') >= 0)
    459509            aoToggleLink[i].textContent = sLinkText;
    460510}
  • trunk/src/VBox/ValidationKit/testmanager/webui/wuimain.py

    r65154 r65160  
    929929        sHtml += u'<div id="side-filters">\n' \
    930930                 u' <p>Filters' \
    931                  u' <a href="javascript:toggleSidebarSize();" class="tm-sidebar-size-link">&#x00bb;&#x00bb;</p>\n'\
    932                  u' <dl>\n';
    933 
     931                 u' <span class="tm-side-filter-title-buttons"><input type="submit" value="Apply" />\n' \
     932                 u' <a href="javascript:toggleSidebarSize();" class="tm-sidebar-size-link">&#x00bb;&#x00bb;</a></span></p>\n';
     933        sHtml += u' <dl>\n';
    934934        for oCrit in oFilter.aCriteria:
    935935            if len(oCrit.aoPossible) > 0:
     
    993993        sHtml += u' <input type="submit" value="Apply"/>\n';
    994994        sHtml += u' <input type="reset" value="Reset"/>\n';
     995        sHtml += u' <button type="button" onclick="clearForm(\'side-menu-form\');">Clear</button>\n';
    995996        sHtml += u'</div>\n';
    996997        return sHtml;
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette