2013-02-17 02:16:37 +01:00
|
|
|
$.tablesorter.addParser({
|
|
|
|
// set a unique id
|
2013-03-30 00:28:58 +01:00
|
|
|
id : 'title',
|
|
|
|
is : function (s) {
|
2013-02-17 02:16:37 +01:00
|
|
|
// return false so this parser is not auto detected
|
|
|
|
return false;
|
|
|
|
},
|
|
|
|
format: function (s) {
|
|
|
|
// format your data for normalization
|
|
|
|
return s.match(/title="(.*?)"/)[1].toLowerCase();
|
|
|
|
},
|
|
|
|
// set type, either numeric or text
|
2013-03-30 00:28:58 +01:00
|
|
|
type : 'text'
|
2013-02-17 02:16:37 +01:00
|
|
|
});
|
|
|
|
|
|
|
|
$.tablesorter.addParser({
|
|
|
|
// set a unique id
|
2013-03-30 00:28:58 +01:00
|
|
|
id : 'date',
|
|
|
|
is : function (s) {
|
2013-02-17 02:16:37 +01:00
|
|
|
// return false so this parser is not auto detected
|
|
|
|
return false;
|
|
|
|
},
|
|
|
|
format: function (s) {
|
|
|
|
// format your data for normalization
|
|
|
|
var match = s.match(/data-date="(.*?)"/)[1];
|
2013-03-30 00:28:58 +01:00
|
|
|
|
|
|
|
if (match === '') {
|
2013-02-17 02:16:37 +01:00
|
|
|
return Date.create().addYears(100).format(Date.ISO8601_DATETIME);
|
2013-03-30 00:28:58 +01:00
|
|
|
}
|
2013-02-17 02:16:37 +01:00
|
|
|
|
|
|
|
return match;
|
|
|
|
},
|
|
|
|
// set type, either numeric or text
|
2013-03-30 00:28:58 +01:00
|
|
|
type : 'text'
|
2013-02-17 02:16:37 +01:00
|
|
|
});
|
|
|
|
|
|
|
|
$.tablesorter.addParser({
|
|
|
|
// set a unique id
|
2013-03-30 00:28:58 +01:00
|
|
|
id : 'innerHtml',
|
|
|
|
is : function (s) {
|
2013-02-17 02:16:37 +01:00
|
|
|
// return false so this parser is not auto detected
|
|
|
|
return false;
|
|
|
|
},
|
|
|
|
format: function (s) {
|
|
|
|
// format your data for normalization
|
|
|
|
return $(s).get(0).innerHTML;
|
|
|
|
},
|
|
|
|
// set type, either numeric or text
|
2013-03-30 00:28:58 +01:00
|
|
|
type : 'text'
|
2013-02-17 02:16:37 +01:00
|
|
|
});
|