Created
March 3, 2010 17:49
-
-
Save dshaw/320807 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* TableSorter 2.0 Parsers | |
* Version 1.0.0 | |
* | |
* Dual licensed under the MIT and GPL licenses: | |
* http://www.opensource.org/licenses/mit-license.php | |
* http://www.gnu.org/licenses/gpl.html | |
* | |
*/ | |
/** | |
* @description html parser - Sorts the *content* of a cell which contains | |
* additional html of no semantic value to the sort. | |
* | |
* @author Daniel D. Shaw ([email protected]) | |
*/ | |
// add parser to handle sorting of text enclosed in html | |
$.tablesorter.addParser({ | |
id: "html", | |
is: function(s) { | |
// return false so this parser is not auto detected | |
// TODO: might actually want to auto detect this. | |
return false; | |
}, | |
format: function(s) { | |
return $.trim(s.toLowerCase().replace(/<.*?>/g, '')); | |
}, | |
type: "text" | |
}); | |
// add parser to handle sorting of text enclosed in html | |
$.tablesorter.addParser({ | |
id: "htmlDigit", | |
is: function(s) { | |
// return false so this parser is not auto detected | |
// TODO: might actually want to auto detect this. | |
return false; | |
}, | |
format: function(s) { | |
return $.trim(s.toLowerCase().replace(/<.*?>/g, '')); | |
}, | |
type: "numeric" | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment