PageSourceSearch

http://healthmap.org/js/listview.js

js healthmap.org collected 2026-10-01 10:14:45 UTC 1,952 bytes, 53 lines download raw bytes

1var default_sort_col = typeof(default_sort_col) == "number" ? default_sort_col : 1;
2$(document).ready(function () {
3    // ratings
4    $('.icon-star').live('click', function() {
5        if(!hmu_id) {
6            return false;
7        }
8        var rating = this.id;
9        yourrating = rating.replace("score","");
10        var classinfo = $(this).attr('class');
11        var classinfoarr = classinfo.split(" ");
12        var fdata = new Object();
13        fdata['alert_id'] = classinfoarr[1];
14        fdata['rating'] = yourrating;
15        var rurl = path_to_main + "submitComment.php";
16        $.ajax({ type: "POST", url: rurl, dataType: 'json', data: fdata,
17            success: function(resp) {
18                if(resp['status'] == "error") {
19                    alert("You must log on to HealthMap to use this functionality.");
20                    return false;
21                }
22                // update stars to be your vote
23                for (var i=1; i<=5; i++) {
24                    $('#score'+i+'.'+fdata['alert_id']).removeClass('selected');
25                    if(i <= yourrating) {
26                        $('#score'+i+'.'+fdata['alert_id']).addClass('selected');
27                    }
28                }
29            }
30        }) 
31        return false;
32    });
33
34    listView = $('#list_view_table').dataTable({
35        "sPaginationType": "full_numbers",
36        "iDisplayLength" : 5,
37        "bLengthChange": true,
38        "aLengthMenu": [[5, 10, 20, -1], [5, 10, 20, "All"]],
39        "aaSorting": [[ default_sort_col, "desc" ]],
40        "bScrollAutoCss": false,
41        "oLanguage": {
42             "oPaginate": {
43                "sNext": "",
44                "sPrevious": "",
45                "sLast": "",
46                "sFirst": ""
47             },
48            "sInfo": "Showing _START_ to _END_ of _TOTAL_ results",
49            "sSearch": "Filter Results _INPUT_",
50            "sLengthMenu": "Display _MENU_ results"
51        }
52    });
53});

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.