Improving the web ui: ability to select all projects at once, switching the order of the query and selected projects.
authorJan Lahoda <jlahoda@netbeans.org>
Thu, 16 Aug 2012 00:08:29 +0200
changeset 8516e261fe869d7
parent 850 2cc1f5991f13
child 852 14b2dae1089d
Improving the web ui: ability to select all projects at once, switching the order of the query and selected projects.
remoting/server/web/web.ui/src/org/netbeans/modules/jackpot30/backend/ui/ui-findType.html
     1.1 --- a/remoting/server/web/web.ui/src/org/netbeans/modules/jackpot30/backend/ui/ui-findType.html	Wed Aug 15 21:28:38 2012 +0200
     1.2 +++ b/remoting/server/web/web.ui/src/org/netbeans/modules/jackpot30/backend/ui/ui-findType.html	Thu Aug 16 00:08:29 2012 +0200
     1.3 @@ -34,16 +34,35 @@
     1.4                                  title: 'Show'
     1.5                              });
     1.6          }
     1.7 +        function checkAllProjectsCheckBox() {
     1.8 +            allChecked = $('.projectCheckBox').filter(function(index) {
     1.9 +                return !this.checked;
    1.10 +            }).length == 0;
    1.11 +            if (!allChecked) $('#allProjectsCheckBox')[0].checked = false;
    1.12 +        }
    1.13 +        function checkCheckBoxes() {
    1.14 +            if (!$('#allProjectsCheckBox')[0].checked) return;
    1.15 +            allChecked = $('.projectCheckBox').each(function(index) {
    1.16 +                this.checked = true;
    1.17 +            }).length == 0;
    1.18 +        }
    1.19 +        $(document).ready(function() {
    1.20 +            checkAllProjectsCheckBox();
    1.21 +        })
    1.22      </script>
    1.23  </head>
    1.24  <body>
    1.25  <form method="get">
    1.26 +<label for="prefix">Search for:</label><input type="text" name="prefix"<#if prefix??>value="${prefix}"</#if>/><br>
    1.27  <label>Projects:</label>
    1.28 +<table><tr>
    1.29 +        <td>    <input id="allProjectsCheckBox" type="checkbox" onclick="checkCheckBoxes();" checked="yes">All</input>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
    1.30  <#list paths as path>
    1.31 -    <input type="checkbox" name="path" value="${path.segment}" <#if selectedPath?? && selectedPath?seq_contains(path.segment)> checked="yes"</#if>>${path.displayName}</input>
    1.32 +<td><input class="projectCheckBox" type="checkbox" name="path" onclick="checkAllProjectsCheckBox();" value="${path.segment}" <#if !selectedPath?? || selectedPath?seq_contains(path.segment)> checked="yes"</#if>>${path.displayName}</input>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
    1.33 +<#if path_index % 5 == 3></tr><tr></#if>
    1.34  </#list>
    1.35 +    </tr></table>
    1.36  <br>
    1.37 -<label for="prefix">Symbol Prefix:</label><input type="text" name="prefix"<#if prefix??>value="${prefix}"</#if>/><br>
    1.38  <input type="submit" name="Find Candidates"/>
    1.39  </form>
    1.40