Source

jackpot30 / language / server / web / language.web.api / src / org / netbeans / modules / jackpot30 / backend / language / api / ui-search.html

<html>
<head>
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
<#if results??>
    <script type="text/javascript">
        //XXX: duplicate:
        function paramValue(param) {
            var $params = window.location.search.substring(1).split("&");

            for (var i = 0; i < $params.length; i++) {
                if ($params[i].indexOf(param + "=") !== (-1)) {
                    return unescape($params[i].substring((param + "=").length));
                }
            }
        }
        $(document).ready(function() {
            if (paramValue("validate") == "true") {
                $('#validate').attr("checked", "true");
            }
            $('#list').find('dd').hide().end().find('dt').click(function() {
                current_dd=$(this).next();
                //XXX: will do the AJAX call for both show and hide!
                $.get("snippet?path=${selectedPath}&relative=" + current_dd.attr("id") + "&pattern=${patternEscaped}",function(data) {
                    current_dd.html(data).slideToggle();
                })
            });
        });
    </script>
</#if>
    <style type="text/css">
        .occurrence {BACKGROUND: #DDDD00;}
    </style>
</head>
<body>
<form method="get">

<label for="path">Project:</label>
<select size="1" name="path">");
    <#list paths as path>
        <option <#if selectedPath?? && path.segment == selectedPath>selected</#if> value="${path.segment}">
            ${path.displayName}
        </option>
    </#list>
</select>
<br>
<label for="pattern">Pattern:</label><br>
<textarea rows="10" cols="40" name="pattern">
<#if pattern??>
${pattern}
</#if>
</textarea><br>
<input type="checkbox" name="validate" value="true" id="validate">Validate (slower)<br>
<input type="submit" name="Find Candidates"/>
</form>

<div class="examples">
<#if examples??>
    Examples:
    <dl id="examples-list">
        <#list examples as example>
            <dt>${example.displayName}</dt>
            <dd><pre>${example.pattern}</pre>
            </dd>
        </#list>
    </dl>
</#if>
</div>

<#if results??>
    Found candidates for pattern: ${pattern}
    <dl id="list">
        <#list results as result>
            <dt>${result.relativePath}<a href="/index/languageui/show?path=${selectedPath}&relative=${result.relativePath}&pattern=${patternEscaped}">show</a></dt>
            <dd id="${result.relativePath}">
            </dd>
        </#list>
    </dl>
</#if>

<#if statistics??>
     Query time: ${statistics.queryTime}ms, matching files: ${statistics.files}.
</#if>
</body>
</html>