~ubuntu-branches/ubuntu/trusty/horizon/trusty

« back to all changes in this revision

Viewing changes to horizon/static/horizon/js/jquery/jquery.table-sorter.js

  • Committer: Package Import Robot
  • Author(s): Chuck Short
  • Date: 2012-03-09 11:50:22 UTC
  • mfrom: (1.1.9)
  • Revision ID: package-import@ubuntu.com-20120309115022-ymiww5i58rbg97my
Tags: 2012.1~rc1~20120308.1479-0ubuntu1
* New upstream version.
* debian/rules: Fix symlink when installing horizon.
  (LP: #947118)
* debian/control: Add python-django-nose as a dep. (LP: #944235)
* debian/control: Fix broken depends.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 * 
 
2
 *
3
3
 * TableSorter 2.0 - Client-side table sorting with ease!
4
4
 * Version 2.0.5b
5
5
 * @requires jQuery v1.2.3
6
 
 * 
 
6
 *
7
7
 * Copyright (c) 2007 Christian Bach
8
8
 * Examples and docs at: http://tablesorter.com
9
9
 * Dual licensed under the MIT and GPL licenses:
10
10
 * http://www.opensource.org/licenses/mit-license.php
11
11
 * http://www.gnu.org/licenses/gpl.html
12
 
 * 
 
12
 *
13
13
 */
14
14
/**
15
 
 * 
 
15
 *
16
16
 * @description Create a sortable table with multi-column sorting capabilitys
17
 
 * 
 
17
 *
18
18
 * @example $('table').tablesorter();
19
19
 * @desc Create a simple tablesorter interface.
20
 
 * 
 
20
 *
21
21
 * @example $('table').tablesorter({ sortList:[[0,0],[1,0]] });
22
22
 * @desc Create a tablesorter interface and sort on the first and secound column column headers.
23
 
 * 
 
23
 *
24
24
 * @example $('table').tablesorter({ headers: { 0: { sorter: false}, 1: {sorter: false} } });
25
 
 *          
 
25
 *
26
26
 * @desc Create a tablesorter interface and disableing the first and second  column headers.
27
 
 *      
28
 
 * 
 
27
 *
 
28
 *
29
29
 * @example $('table').tablesorter({ headers: { 0: {sorter:"integer"}, 1: {sorter:"currency"} } });
30
 
 * 
 
30
 *
31
31
 * @desc Create a tablesorter interface and set a column parser for the first
32
32
 *       and second column.
33
 
 * 
34
 
 * 
 
33
 *
 
34
 *
35
35
 * @param Object
36
36
 *            settings An object literal containing key/value pairs to provide
37
37
 *            optional settings.
38
 
 * 
39
 
 * 
 
38
 *
 
39
 *
40
40
 * @option String cssHeader (optional) A string of the class name to be appended
41
41
 *         to sortable tr elements in the thead of the table. Default value:
42
42
 *         "header"
43
 
 * 
 
43
 *
44
44
 * @option String cssAsc (optional) A string of the class name to be appended to
45
45
 *         sortable tr elements in the thead on a ascending sort. Default value:
46
46
 *         "headerSortUp"
47
 
 * 
 
47
 *
48
48
 * @option String cssDesc (optional) A string of the class name to be appended
49
49
 *         to sortable tr elements in the thead on a descending sort. Default
50
50
 *         value: "headerSortDown"
51
 
 * 
 
51
 *
52
52
 * @option String sortInitialOrder (optional) A string of the inital sorting
53
53
 *         order can be asc or desc. Default value: "asc"
54
 
 * 
 
54
 *
55
55
 * @option String sortMultisortKey (optional) A string of the multi-column sort
56
56
 *         key. Default value: "shiftKey"
57
 
 * 
 
57
 *
58
58
 * @option String textExtraction (optional) A string of the text-extraction
59
59
 *         method to use. For complex html structures inside td cell set this
60
60
 *         option to "complex", on large tables the complex option can be slow.
61
61
 *         Default value: "simple"
62
 
 * 
 
62
 *
63
63
 * @option Object headers (optional) An array containing the forces sorting
64
64
 *         rules. This option let's you specify a default sorting rule. Default
65
65
 *         value: null
66
 
 * 
 
66
 *
67
67
 * @option Array sortList (optional) An array containing the forces sorting
68
68
 *         rules. This option let's you specify a default sorting rule. Default
69
69
 *         value: null
70
 
 * 
 
70
 *
71
71
 * @option Array sortForce (optional) An array containing forced sorting rules.
72
72
 *         This option let's you specify a default sorting rule, which is
73
73
 *         prepended to user-selected rules. Default value: null
74
 
 * 
 
74
 *
75
75
 * @option Boolean sortLocaleCompare (optional) Boolean flag indicating whatever
76
76
 *         to use String.localeCampare method or not. Default set to true.
77
 
 * 
78
 
 * 
 
77
 *
 
78
 *
79
79
 * @option Array sortAppend (optional) An array containing forced sorting rules.
80
80
 *         This option let's you specify a default sorting rule, which is
81
81
 *         appended to user-selected rules. Default value: null
82
 
 * 
 
82
 *
83
83
 * @option Boolean widthFixed (optional) Boolean flag indicating if tablesorter
84
84
 *         should apply fixed widths to the table columns. This is usefull when
85
85
 *         using the pager companion plugin. This options requires the dimension
86
86
 *         jquery plugin. Default value: false
87
 
 * 
 
87
 *
88
88
 * @option Boolean cancelSelection (optional) Boolean flag indicating if
89
89
 *         tablesorter should cancel selection of the table headers text.
90
90
 *         Default value: true
91
 
 * 
 
91
 *
92
92
 * @option Boolean debug (optional) Boolean flag indicating if tablesorter
93
93
 *         should display debuging information usefull for development.
94
 
 * 
 
94
 *
95
95
 * @type jQuery
96
 
 * 
 
96
 *
97
97
 * @name tablesorter
98
 
 * 
 
98
 *
99
99
 * @cat Plugins/Tablesorter
100
 
 * 
 
100
 *
101
101
 * @author Christian Bach/christian.bach@polyester.se
102
102
 */
103
103
 
347
347
                            tableBody[0].appendChild(r[pos][j]);
348
348
                        }
349
349
 
350
 
                        // 
 
350
                        //
351
351
                    }
352
352
                }
353
353
 
381
381
                }
382
382
 
383
383
                var meta = ($.metadata) ? true : false;
384
 
                
 
384
 
385
385
                var header_index = computeTableHeaderCellIndexes(table);
386
386
 
387
387
                $tableHeaders = $(table.config.selectorHeaders, table).each(function (index) {
389
389
                    this.column = header_index[this.parentNode.rowIndex + "-" + this.cellIndex];
390
390
                    // this.column = index;
391
391
                    this.order = formatSortingOrder(table.config.sortInitialOrder);
392
 
                    
393
 
                                        
 
392
 
 
393
 
394
394
                                        this.count = this.order;
395
395
 
396
396
                    if (checkHeaderMetadata(this) || checkHeaderOptions(table, index)) this.sortDisabled = true;
493
493
                };
494
494
                return false;
495
495
            }
496
 
                        
 
496
 
497
497
                         function checkHeaderOptionsSortingLocked(table, i) {
498
498
                if ((table.config.headers[i]) && (table.config.headers[i].lockedOrder)) return table.config.headers[i].lockedOrder;
499
499
                return false;
500
500
            }
501
 
                        
 
501
 
502
502
            function applyWidget(table) {
503
503
                var c = table.config.widgets;
504
504
                var l = c.length;
727
727
                            this.order = this.count++ % 2;
728
728
                                                        // always sort on the locked order.
729
729
                                                        if(this.lockedOrder) this.order = this.lockedOrder;
730
 
                                                        
 
730
 
731
731
                                                        // user only whants to sort on one
732
732
                            // column
733
733
                            if (!e[config.sortMultiSortKey]) {