styling upload button on course_list - turns orange on :hover instead of drawing...
[oweals/karmaworld.git] / karmaworld / assets / js / sort-tables.js
1
2 // configure the jquery.tablesorter plugin to sort and filter the course list
3 $(function()
4 {
5   // define pager options
6   var pagerOptions = {
7     // target the pager markup - see the HTML block below
8     container: $(".pager"),
9     // output string - default is '{page}/{totalPages}'; possible variables: {page}, {totalPages}, {startRow}, {endRow} and {totalRows}
10     output: '{startRow} - {endRow} / {filteredRows} ({totalRows})',
11     // if true, the table will remain the same height no matter how many records are displayed. The space is made up by an empty
12     // table row set to a height to compensate; default is false
13     fixedHeight: true,
14     // remove rows from the table to speed up the sort of large tables.
15     // setting this to false, only hides the non-visible rows; needed if you plan to add/remove rows with the pager enabled.
16     removeRows: false,
17     // go to page selector - select dropdown that sets the current page
18     cssGoto:   '.gotoPage'
19   };
20
21   var widgetOptions = {
22     // stripe rows. doesn't work with filter plugin
23     zebra : [ "odd", "even" ],
24
25     //Resizable widget: If this option is set to false, resized column widths will not be saved.
26     //Previous saved values will be restored on page reload.
27     resizable: false,
28
29     // If there are child rows in the table (rows with class name from "cssChildRow" option)
30     // and this option is true and a match is found anywhere in the child row, then it will make that row
31     // visible; default is false
32     filter_childRows : false,
33
34     // if true, a filter will be added to the top of each table column;
35     // disabled by using -> headers: { 1: { filter: false } } OR add class="filter-false"
36     // if you set this to false, make sure you perform a search using the second method below
37     filter_columnFilters : true,
38
39     // css class applied to the table row containing the filters & the inputs within that row
40     //filter_cssFilter : 'tablesorter-filter',
41
42     // add custom filter functions using this option
43     // see the filter widget custom demo for more specifics on how to use this option
44     filter_functions : null,
45
46     // if true, filters are collapsed initially, but can be revealed by hovering over the grey bar immediately
47     // below the header row. Additionally, tabbing through the document will open the filter row when an input gets focus
48     filter_hideFilters : false,
49
50     // Set this option to false to make the searches case sensitive
51     filter_ignoreCase : true,
52
53     // jQuery selector string of an element used to reset the filters
54     filter_reset : 'button.reset',
55
56     // Delay in milliseconds before the filter widget starts searching; This option prevents searching for
57     // every character while typing and should make searching large tables faster.
58     filter_searchDelay : 150,
59
60     // Set this option to true to use the filter to find text from the start of the column
61     // So typing in "a" will find "albert" but not "frank", both have a's; default is false
62     filter_startsWith : false,
63
64     // Filter using parsed content for ALL columns
65     // be careful on using this on date columns as the date is parsed and stored as time in seconds
66     filter_useParsedData : false,
67   };
68
69
70   // initialise the tablesorter
71   $("#course_list").tablesorter(
72   {
73     widgets: ["filter", "zebra"],
74     headers: { 3: { filter: false, sorter: true }, 4: { filter: false, sorter: true } },
75     widgetOptions: widgetOptions
76   });
77
78   $("#course_list").tablesorterPager(pagerOptions);
79   console.log('Finished initing tablesorterPager');
80 });