PageSourceSearch

https://www.bancomundial.org/etc/designs/wbrrdesign/clientlibs-worldbankgroup/js/tablesort.js

js bancomundial.org collected 2026-09-24 08:28:15 UTC 2,444 bytes, 66 lines download raw bytes

1//$(document).ready(function(){
2    export function tableSort(){
3        $(".tablesorter table").each(function(i){  
4            if($(this).parent().attr('class').indexOf("table-sort")>-1){
5                $(this).attr("id","sortTable"+i);  
6                var table = $('#sortTable'+i);       
7                var headRow = $('tbody tr', table).first();
8                headRow.remove();   
9                if (!table.has('tbody')) {
10                    var otherRows = $('tr', table);
11                    otherRows.remove();            
12                    var tbody = $('<tbody>');
13                    table.append(tbody);
14                    tbody.append(otherRows);
15                }    
16                var thead = $('<thead>');
17                table.prepend(thead);
18                thead.append(headRow);
19                $("thead tr:first-child td").each(function() {
20                    var colspan = null;
21                    colspan = $(this).attr('colspan');
22                    console.log($(this).text());
23    
24                    $(this).replaceWith('<th colspan='+colspan+'>' + $(this).text() + '</th>'); 
25    
26                    if(colspan !=null){
27                        $(this).attr('colspan',colspan);
28                    }
29                });
30    
31                $("#sortTable"+i).tablesorter(); 
32            }
33        });
34    }
35	export function noTableSort(){
36        $("div.nosort table").each(function(i){   
37            var tableParentClass = $(this).parent().attr('class');
38            if(tableParentClass!==undefined){
39            if($(this).parent().parent().parent().attr('class').indexOf("table")>-1){            
40                $(this).find("tbody tr:first-child td").each(function() {
41                    var colspan = null;
42                    colspan = $(this).attr('colspan');
43    
44    
45                    $(this).replaceWith('<th colspan='+colspan+'>' + $(this).text() + '</th>');  
46
47                });           
48            }
49            }
50        });
51    }
52    export function tableBorder(){
53        $(".tablesorter").each(function(i){ 
54            var borderClass = $(this).parent().attr('class');
55            if(borderClass!== undefined){
56            if($(this).parent().attr('class').indexOf("border")>-1){
57                $(this).find("tbody tr td").each(function(){
58                    $(this).addClass("border");
59                });
60            } 
61            }
62        }); 
63    }
64
65    
66//}); 

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.