~erobererunc/sahana-eden/tropo_xforms

« back to all changes in this revision

Viewing changes to views/dataTables.html

  • Committer: Michael
  • Date: 2010-12-16 13:45:28 UTC
  • mfrom: (1479.1.91 eden)
  • Revision ID: ero@gmail.com-20101216134528-7x3m6m3fk9uc9i69
mergeĀ fromĀ trunk...

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
 <script src="/{{=request.application}}/static/scripts/S3/jquery.dataTables.min.js" type="text/javascript" charset="utf-8"></script>
5
5
{{pass}}
6
6
<script type="text/javascript">//<![CDATA[
 
7
var Utf8 = {
 
8
    // http://www.webtoolkit.info
 
9
    // @ToDo: Move to S3.min.js
 
10
    encode : function (string) {
 
11
        string = string.replace(/\r\n/g, '\n');
 
12
        var utftext = '';
 
13
        for (var n = 0; n < string.length; n++) {
 
14
            var c = string.charCodeAt(n);
 
15
            if (c < 128) {
 
16
                utftext += String.fromCharCode(c);
 
17
            }
 
18
            else if((c > 127) && (c < 2048)) {
 
19
                utftext += String.fromCharCode((c >> 6) | 192);
 
20
                utftext += String.fromCharCode((c & 63) | 128);
 
21
            }
 
22
            else {
 
23
                utftext += String.fromCharCode((c >> 12) | 224);
 
24
                utftext += String.fromCharCode(((c >> 6) & 63) | 128);
 
25
                utftext += String.fromCharCode((c & 63) | 128);
 
26
            }
 
27
        }
 
28
        return utftext;
 
29
    },
 
30
    decode : function (utftext) {
 
31
        var string = '';
 
32
        var i = 0;
 
33
        var c = c1 = c2 = 0;
 
34
        while ( i < utftext.length ) {
 
35
            c = utftext.charCodeAt(i);
 
36
            if (c < 128) {
 
37
                string += String.fromCharCode(c);
 
38
                i++;
 
39
            }
 
40
            else if((c > 191) && (c < 224)) {
 
41
                c2 = utftext.charCodeAt(i+1);
 
42
                string += String.fromCharCode(((c & 31) << 6) | (c2 & 63));
 
43
                i += 2;
 
44
            }
 
45
            else {
 
46
                c2 = utftext.charCodeAt(i+1);
 
47
                c3 = utftext.charCodeAt(i+2);
 
48
                string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));
 
49
                i += 3;
 
50
            }
 
51
        }
 
52
        return string;
 
53
    }
 
54
}
7
55
$(document).ready(function() {
8
56
    // Create an array for the column settings (this is required, otherwise the column widths don't autosize)
9
57
    var myList = document.getElementById('list');
148
196
                id = re.exec(aData[0])[1];
149
197
                c = Actions[i]._class
150
198
                re = /%5Bid%5D/g;
151
 
                Buttons = Buttons + '<a class="'+ c +'" href="' + Actions[i].url.replace(re, id) + '">' + Actions[i].label + '</a>' + '&nbsp;';
 
199
                Buttons = Buttons + '<a class="'+ c +'" href="' + Actions[i].url.replace(re, id) + '">' + Utf8.decode(Actions[i].label) + '</a>' + '&nbsp;';
152
200
            }
153
201
            // Set the first column to the action buttons
154
202
            $('td:eq(0)', nRow).html( Buttons );