From 26493ec8bcb16439a5b8ba1066af9dbcd25fe8a0 Mon Sep 17 00:00:00 2001 From: Mottie Date: Fri, 11 Jul 2014 14:59:57 -0500 Subject: [PATCH] Parsers: Add image alt parser --- js/parsers/parser-image.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 js/parsers/parser-image.js diff --git a/js/parsers/parser-image.js b/js/parsers/parser-image.js new file mode 100644 index 00000000..6fca61d8 --- /dev/null +++ b/js/parsers/parser-image.js @@ -0,0 +1,20 @@ +/*! image alt attribute parser for jQuery 1.7+ & tablesorter 2.7.11+ + * New 7/8/2014 (v2.17.4) + */ +/*jshint jquery:true, unused:false */ +;(function($){ +"use strict"; + + $.tablesorter.addParser({ + id: "image", + is: function(){ + return false; + }, + format: function(s, table, cell) { + return $(cell).find('img').attr(table.config.imgAttr || 'alt') || s; + }, + parsed : true, // filter widget flag + type: "text" + }); + +})(jQuery);