Subversion Repositories bacoAlunos

Rev

Rev 1312 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1312 Rev 1353
Line 4... Line 4...
4
  Date: 9/Jul/2008
4
  Date: 9/Jul/2008
5
  Time: 16:52:37
5
  Time: 16:52:37
6
  To change this template use File | Settings | File Templates.
6
  To change this template use File | Settings | File Templates.
7
--%>
7
--%>
8
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
8
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
-
 
9
<jsp:useBean id="CourseUnitView" type="pt.estgp.estgweb.domain.views.CourseUnitView" scope="request"/>
-
 
10
<script>
-
 
11
    var jsonFiles = JSON.parse('${CourseUnitView.courseUnit.filesJson}');
-
 
12
    function searchFilesUnit(){
-
 
13
        $(".searchResults").html("<div class=\"files\"><table></table></div>");
-
 
14
        var text =  $("#searchFiles").val().toLowerCase();
-
 
15
        jsonFiles.forEach(function(item){
-
 
16
            if (item.filename.toLowerCase().search(text) != -1) {
-
 
17
                $(".searchResults .files table").append(
-
 
18
                        "<tr class=\"file\">" +
-
 
19
                                "<td>" +
-
 
20
                                    "<img src=\"<%=request.getContextPath()%>/imgs/mime/" + item.extension +".gif\"/>" +
-
 
21
                                    " <a href=\"<%=request.getContextPath()%>/ftpProxyStream/ionline" + item.fileCompletePathEncoded + "\">" +
-
 
22
                                        item.file +
-
 
23
                                    "</a>"+
-
 
24
                                "</td>" +
-
 
25
                                "<td>" + item.lastmodifieddate + "</td>" +
-
 
26
                                "<td>" + item.size + "</td>" +
-
 
27
                        "</tr>"
9
 
28
 
-
 
29
                );
-
 
30
            }
-
 
31
        });
-
 
32
    }
-
 
33
    $(document).ready(
-
 
34
            function(){
-
 
35
                $(".ftpClientPanel .panel-heading").append(
-
 
36
                    "<span class=\"pull-right\"><input type=\"text\" id=\"searchFiles\"><button class=\"btn btn-default\" id=\"searchFilesBtn\" type=\"button\"><span class=\"glyphicon glyphicon-search\"></button></span>"
-
 
37
 
-
 
38
                );
-
 
39
                $(".ftpClientPanel .panel-heading").after(
-
 
40
                        "<div class=\"panel-body searchResults\"></div>"
-
 
41
                );
-
 
42
 
-
 
43
                $("#searchFilesBtn").click(searchFilesUnit);
-
 
44
                $('#searchFiles').bind("keypress", function(e) {
-
 
45
                    if (e.keyCode == 13) {
-
 
46
                        searchFilesUnit();
-
 
47
                    }
-
 
48
                });
-
 
49
            }
-
 
50
    );
-
 
51
</script>
10
<jsp:include page="/user/ftpclient/ftpclient.jsp"/>
52
<jsp:include page="/user/ftpclient/ftpclient.jsp"/>