Subversion Repositories DevTools

Rev

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

Rev 6378 Rev 6379
Line 32... Line 32...
32
    parCompare = "true"
32
    parCompare = "true"
33
End If
33
End If
34
'----------------------------------------------
34
'----------------------------------------------
35
%>
35
%>
36
<script type="text/javascript" charset="utf-8">
36
<script type="text/javascript" charset="utf-8">
37
function toggleTable(dir, el)
-
 
38
{
-
 
39
    $('html, body').css("cursor", "wait");
-
 
40
 
-
 
41
    var dirEl = $(el).closest('.tag-isDir');
-
 
42
    var isHidden = dirEl.hasClass('tag-isHidden');
-
 
43
    //dirEl.find('img').toggleClass('display-none');
-
 
44
    dirEl.toggleClass('tag-isHidden');
-
 
45
    
-
 
46
    $('#fileList tr td:nth-child(2)').each(function(idx, item){
-
 
47
        var txt =  item.innerText;
-
 
48
        if ( txt.indexOf(dir) == 0 ) {
-
 
49
            var tr = $(item.closest('tr'));
-
 
50
            if ( isHidden ) {
-
 
51
                tr.removeClass('display-none');
-
 
52
            } else {
-
 
53
                tr.addClass('display-none');
-
 
54
            };
-
 
55
            if ( tr.hasClass('tag-isDir') ) {
-
 
56
                if ( isHidden ) {
-
 
57
                    tr.removeClass('tag-isHidden');
-
 
58
                } else {
-
 
59
                    tr.addClass('tag-isHidden');
-
 
60
                };
-
 
61
 
-
 
62
            }
-
 
63
        };
-
 
64
    });
-
 
65
    updateTableIcons();
-
 
66
    $('html, body').css("cursor", "default");
-
 
67
}
-
 
68
 
-
 
69
function openTableAll()
37
function openTableAll()
70
{
38
{
71
    $('#fileList tr').each(function(idx, item){
39
    $('#fileList tr').each(function(idx, item){
72
        $(item).removeClass('display-none');
40
        $(item).removeClass('display-none');
73
        $(item).removeClass('tag-isHidden');
41
        $(item).removeClass('tag-isHidden');
Line 76... Line 44...
76
}
44
}
77
 
45
 
78
function closeTableAll()
46
function closeTableAll()
79
{
47
{
80
    $('#fileList tr td:nth-child(2)').each(function(idx, item){
48
    $('#fileList tr td:nth-child(2)').each(function(idx, item){
81
        var txt =  item.innerText;
-
 
82
        $(item.closest('tr')).addClass('tag-isHidden');
49
        $(item.closest('tr')).addClass('tag-isHidden');
-
 
50
        var txt =  item.innerText;
83
        if ( txt.indexOf("/") >= 0 ) {
51
        if ( txt.indexOf("/") >= 0 ) {
84
            $(item.closest('tr')).addClass('display-none');
52
            $(item.closest('tr')).addClass('display-none');
85
        };
53
        };
86
    });
54
    });
87
    updateTableIcons();
55
    updateTableIcons();
88
}
56
}
89
 
57
 
90
function updateTableIcons()
58
function updateTableIcons()
91
{
59
{
92
    $("#fileList tr.tag-isDir").each(function(i, item)
60
    $("#fileList tr.tag-isDir").each(function(i, item) {
93
    {
-
 
94
        var isHidden = $(item).hasClass('tag-isHidden');
61
        var isHidden = $(item).hasClass('tag-isHidden');
95
        updateImages(item, isHidden);
62
        updateImages(item, isHidden);
96
    });
63
    });
97
}
64
}
98
 
65
 
Line 106... Line 73...
106
        $(images.get(0)).removeClass('display-none');
73
        $(images.get(0)).removeClass('display-none');
107
    }
74
    }
108
}
75
}
109
 
76
 
110
function tableToggleAll(el) {
77
function tableToggleAll(el) {
111
    var mode =  $(el).hasClass('tag-hideAll'); 
78
    var mode =  $('#fileList').hasClass('tag-ALL'); 
112
    if (mode ) {
79
    if (mode) {
113
        openTableAll();
-
 
114
    } else {
-
 
115
        closeTableAll();
80
        closeTableAll();
-
 
81
    } else {
-
 
82
        openTableAll();
116
    };
83
    };
117
    updateImages(el, !mode);
84
    updateImages(el, !mode);
118
    $(el).toggleClass('tag-hideAll');
85
    $('#fileList').toggleClass('tag-ALL');
119
}
86
}
-
 
87
 
-
 
88
$( document ).ready(function() {
-
 
89
 
-
 
90
    // Open / Close directory elements
-
 
91
    $('#fileList tr td:first-child').click(function() {
-
 
92
 
-
 
93
       // Calculate the text name of the parent directory
-
 
94
       var tr = $(this.closest('tr'));
-
 
95
       var dir = $(tr).children('td').eq(1).get(0).innerText;
-
 
96
       if ( ! $(tr).hasClass('tag-isDir') ) {
-
 
97
           dir=dir.replace(/\/[^\/]*$/,'');
-
 
98
       }
-
 
99
 
-
 
100
       // Scan table:
-
 
101
       //   Looking for directory element
-
 
102
       //   Then show/hide elements
-
 
103
       var isHidden = false;
-
 
104
       var found = false;
-
 
105
       $('#fileList tr td:nth-child(2)').each(function(idx, item){
-
 
106
           var txt =  item.innerText;
-
 
107
           if ( !found ) {
-
 
108
               if ( txt.indexOf(dir) == 0 )
-
 
109
               {
-
 
110
                   var tr = $(item.closest('tr'));
-
 
111
                   isHidden = tr.hasClass('tag-isHidden');
-
 
112
                   tr.toggleClass('tag-isHidden');
-
 
113
                   found = true;
-
 
114
               }
-
 
115
           } else {
-
 
116
               if ( txt.indexOf(dir)  < 0 ) return false;
-
 
117
               var tr = $(item.closest('tr'));
-
 
118
               if ( isHidden ) {
-
 
119
                   tr.removeClass('display-none');
-
 
120
               } else {
-
 
121
                   tr.addClass('display-none');
-
 
122
               };
-
 
123
               if ( tr.hasClass('tag-isDir') ) {
-
 
124
                   if ( isHidden ) {
-
 
125
                       tr.removeClass('tag-isHidden');
-
 
126
                   } else {
-
 
127
                       tr.addClass('tag-isHidden');
-
 
128
                   };
-
 
129
               }
-
 
130
           }
-
 
131
        });
-
 
132
 
-
 
133
       updateTableIcons();
-
 
134
    });
-
 
135
});
120
</script>
136
</script>
121
<%
137
<%
122
'--------------------------------------------------------------------------------------------------------------------------------------
138
'--------------------------------------------------------------------------------------------------------------------------------------
123
Sub DisplayMessage ()
139
Sub DisplayMessage ()
124
    If (pkgInfoHash.Item ("dlocked") = "Y") Then
140
    If (pkgInfoHash.Item ("dlocked") = "Y") Then
Line 393... Line 409...
393
            Else
409
            Else
394
            %>
410
            %>
395
            <table id="fileList" width="100%"  border="0" cellspacing="1" cellpadding="3">
411
            <table id="fileList" width="100%"  border="0" cellspacing="1" cellpadding="3">
396
            <tr class="form_field_hdr">
412
            <tr class="form_field_hdr">
397
              <td width="1%" onclick="tableToggleAll(this)">
413
              <td width="1%" onclick="tableToggleAll(this)">
398
                    <img class='' src='images/rex_images/_folderopen.gif' border='0' hspace='3' align='absmiddle' title='Close all'>
414
                    <img class='display-none' src='images/rex_images/_folderopen.gif' border='0' hspace='3' align='absmiddle' title='Close all'>
399
                    <img class='display-none' src='images/rex_images/_folder.gif' border='0' hspace='3' align='absmiddle' title='Expand All'>
415
                    <img class='' src='images/rex_images/_folder.gif' border='0' hspace='3' align='absmiddle' title='Expand All'>
400
              </td>
416
              </td>
401
              <td width="25%" >Name</td>
417
              <td width="25%" >Name</td>
402
              <td width="25%" align="right">Byte Size</td>
418
              <td width="25%" align="right">Byte Size</td>
403
              <td width="25%" align="right">CKSUM</td>
419
              <td width="25%" align="right">CKSUM</td>
404
              <td width="25%" align="right">MODCRC</td>
420
              <td width="25%" align="right">MODCRC</td>
405
            </tr>
421
            </tr>
406
            <%
422
            <%
407
            Dim dClass, nextClass, altClass
423
            Dim dClass, nextClass, altClass
408
            Dim isHidden , bFirst
424
            Dim isHidden , bFirst
409
            Dim filePath
425
            Dim filePath
410
            Dim tag
-
 
411
            Dim curDir, hiddenBase
426
            Dim curDir, hiddenBase
-
 
427
            Dim knownDirs : knownDirs = Array ("lcov", "doc", "utfResults" )
412
            Dim sClick
428
            Dim item
-
 
429
 
413
            dClass = ""
430
            dClass = ""
414
            nextClass = ""
-
 
415
            isHidden = FALSE
431
            isHidden = FALSE
416
            curDir = ""
432
            curDir = ""
417
            sClick =  ""
-
 
418
 
-
 
419
            Dim knownDirs : knownDirs = Array ("lcov", "doc", "utfResults" )
-
 
420
            Dim item
-
 
421
 
433
 
422
            While ((NOT rsQry.BOF) AND (NOT rsQry.EOF))
434
            While ((NOT rsQry.BOF) AND (NOT rsQry.EOF))
423
                    sLink = dpkg_archiveURL & pkgInfoHash.Item ("pkg_name") &"/"& pkgInfoHash.Item ("pkg_version") &"/"& Replace( rsQry("file_path") & rsQry("file_name"), "\", "/" )
435
                    sLink = dpkg_archiveURL & pkgInfoHash.Item ("pkg_name") &"/"& pkgInfoHash.Item ("pkg_version") &"/"& Replace( rsQry("file_path") & rsQry("file_name"), "\", "/" )
424
                    filePath = rsQry("file_path")
436
                    filePath = rsQry("file_path")
425
                    If IsNull(filePath) Then filePath = ""
437
                    If IsNull(filePath) Then filePath = ""
Line 433... Line 445...
433
                                
445
                                
434
                    ' Find if this is file or folder
446
                    ' Find if this is file or folder
435
                    If IsNull( rsQry("crc_cksum") )  AND  (rsQry("byte_size") = 0) Then
447
                    If IsNull( rsQry("crc_cksum") )  AND  (rsQry("byte_size") = 0) Then
436
                        ' Is a folder
448
                        ' Is a folder
437
                        curDir = filePath
449
                        curDir = filePath
-
 
450
                        sSize = ""
438
                        dClass = "tag-isDir"
451
                        dClass = "tag-isDir"
439
                         If NOT isHidden Then
452
                         If NOT isHidden Then
440
                             For Each item in knownDirs
453
                             For Each item in knownDirs
441
                                If filePath = item Then
454
                                If filePath = item Then
442
                                    isHidden = TRUE
455
                                    isHidden = TRUE
Line 470... Line 483...
470
                    Else
483
                    Else
471
                        If isHidden Then
484
                        If isHidden Then
472
                            dClass = dClass & " display-none tag-isHidden"
485
                            dClass = dClass & " display-none tag-isHidden"
473
                        End If
486
                        End If
474
                    End If
487
                    End If
475
 
-
 
476
                    sClick =  "onclick=""toggleTable('"& curDir & "/', this);"""
-
 
477
                                
-
 
478
                %>
488
                    %>
479
                <tr class="<%=dClass%> form_field_grey_bg body_txt_gray">
489
                    <tr class="<%=dClass%> form_field_grey_bg body_txt_gray">
480
                  <td nowrap <%=sClick%>><%=sIcon%></td>
490
                      <td nowrap ><%=sIcon%></td>
481
                  <td nowrap><a target="_blank" href="<%=sLink%>" class="body_txt_gray_link"><%=filePath & rsQry("file_name")%></a></td>
491
                      <td nowrap><a target="_blank" href="<%=sLink%>" class="body_txt_gray_link"><%=filePath & rsQry("file_name")%></a></td>
482
                  <td nowrap align="right"><%=sSize%></td>
492
                      <td nowrap align="right"><%=sSize%></td>
483
                  <td nowrap align="right"><%=rsQry("crc_cksum")%></td>
493
                      <td nowrap align="right"><%=rsQry("crc_cksum")%></td>
484
                  <td nowrap align="right"><%=rsQry("crc_modcrc")%></td>
494
                      <td nowrap align="right"><%=rsQry("crc_modcrc")%></td>
485
                </tr>
495
                    </tr>
486
                <%
496
                    <%
487
                rsQry.MoveNext
497
                rsQry.MoveNext
488
            WEnd
498
            WEnd
489
            rsQry.Close()
499
            rsQry.Close()
490
            Set rsQry = nothing
500
            Set rsQry = nothing
491
            %>
501
            %>