mirror of
https://github.com/Mottie/tablesorter.git
synced 2024-11-15 23:54:22 +00:00
2 lines
1.2 KiB
JavaScript
2 lines
1.2 KiB
JavaScript
/*! Parser: ignoreArticles - updated 9/15/2014 (v2.17.8) */
|
|
!function(e){"use strict";var r=e.tablesorter;r.ignoreArticles={en:"the, a, an",de:"der, die, das, des, dem, den, ein, eine, einer, eines, einem, einen",nl:"de, het, de, een",es:"el, la, lo, los, las, un, una, unos, unas",pt:"o, a, os, as, um, uma, uns, umas",fr:"le, la, l'_, les, un, une, des",it:"il, lo, la, l'_, i, gli, le, un', uno, una, un",hu:"a, az, egy"},r.addParser({id:"ignoreArticles",is:function(){return!1},format:function(s,a,n,i){var t,l,d,o=a.config,g=s||"";return o.headers&&o.headers[i]&&o.headers[i].ignoreArticlesRegex||(o.headers||(o.headers={}),o.headers[i]||(o.headers[i]={}),d=r.getData(o.$headers.eq(i),r.getColumnData(a,o.headers,i),"ignoreArticles"),t=(r.ignoreArticles[d]||"the, a, an")+"",o.headers[i].ignoreArticlesRegex=new RegExp("^("+e.trim(t.split(/\s*\,\s*/).join("\\s|")+"\\s").replace("_\\s","")+")","i"),l=r.getData(o.$headers.eq(i),r.getColumnData(a,o.headers,i),"ignoreArticlesExcept"),o.headers[i].ignoreArticlesRegex2=""!==l?new RegExp("^("+l.replace(/\s/g,"\\s")+")","i"):""),t=o.headers[i].ignoreArticlesRegex,!t.test(g)||(l=o.headers[i].ignoreArticlesRegex2)&&l.test(g)?g:g.replace(t,"")},type:"text"})}(jQuery); |