1/* 2 jQuery Typographer 3 Copyright (C) 2011 by mirz 4 5 Permission is hereby granted, free of charge, to any person obtaining a copy 6 of this software and associated documentation files (the "Software"), to deal 7 in the Software without restriction, including without limitation the rights 8 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 copies of the Software, and to permit persons to whom the Software is 10 furnished to do so, subject to the following conditions: 11 12 The above copyright notice and this permission notice shall be included in 13 all copies or substantial portions of the Software. 14 15 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 THE SOFTWARE. 22*/ 23(function(a,c,b,h){var d;function g(e,b){this.context=e;this.$context=a(e);this.options=a.extend({},a.fn[d].defaults,b);this.init()}d="typographer";g.prototype.init=function(){this.$context.addClass(this.options.contextClass);this.execute()};g.prototype.execute=function(){var e=this;a.each(e.options.modules,function(b,c){var d=g.getModuleFn(c);d!==h&&"function"==typeof d?(d=g.getModuleFullName(c),e.$context[d].call(e.$context,e.options[c])):a.error("Module "+c+" does not exist!")})};g.getModuleFn= 24function(e){e=g.getModuleFullName(e);return a.fn[e]};g.getModuleFullName=function(a){return d+"_"+a};a.fn[d]=function(e){return this.each(function(){a.data(this,d)||a.data(this,d,new g(this,e))})};a.fn[d].defaults={contextClass:"jquery-"+d,modules:[]}})(jQuery,window,document);(function(a){var c=/([.?*+^$[\]\\(){}|-])/g;a.typographer_common=a.typographer_common||{};a.typographer_common.normalizeTagNames=function(b){return a.map(b,function(a){return a.toLowerCase()})};a.typographer_common.getTextNodesIn=function(a,c){function d(a){if(a.nodeType==o)(c||!e.test(a.nodeValue))&&g.push(a);else for(var b=0,f=a.childNodes.length;b<f;++b)d(a.childNodes[b])}var g=[],e=/^\s*$/,o=3;d(a);return g};a.typographer_common.shouldIgnore=function(b,c,d){for(;b!==c;){if(b.tagName&&-1<a.inArray(b.tagName.toLowerCase(), 25d.ignoreTags)||a(b).hasClass(d.ignoreClass))return!0;b=b.parentNode}return!1};a.typographer_common.quoteRegex=function(a){return(a+"").replace(c,"\\$1")}})(jQuery,window,document);(function(a){var c;function b(e,b){this.context=e;this.$context=a(e);this.options=a.extend({},a.fn[c].defaults,b);this.init()}function h(a){a=a.forbidden.join("|");b.findOrphanRegex=RegExp("("+a+")(?:\\n|\\s)+","gi");b.orphanAtTheEndRegex=RegExp("\\s+("+a+")$","i")}c=void 0;c="typographer_orphan";b.prototype.init=function(){this.options.ignoreTags=d.normalizeTagNames(this.options.ignoreTags);this.$context.addClass(this.options.contextClass);h(this.options);this.execute()};b.prototype.execute=function(){var e= 26!1,c=d.getTextNodesIn(this.context,!1),p=this;a.each(c,function(){if(d.shouldIgnore(this,p.context,p.options))return!0;var a=this.nodeValue,a=b.deorphanize(a,this.options);e&&(a=a.replace(/^\s+/,g.nbsp),e=!1);b.orphanAtTheEndRegex.test(a)&&(e=!0);this.nodeValue=a})};b.deorphanize=function(e,o){o=a.extend({},a.fn[c].defaults,o);b.findOrphanRegex||h(o);return e=e.replace(b.findOrphanRegex,function(a,b,c){c=e.substring(c-1,c);return" "!==c&&""!==c?a:b+g.nbsp})};a.fn[c]=function(e){return this.each(function(){a.data(this, 27c)||a.data(this,c,new b(this,e))})};a.fn[c].entities={nbsp:"\u00a0"};a.fn[c].defaults={contextClass:"jquery-typographer-orphan",forbidden:"aiouwz".split(""),ignoreTags:["pre","code"],ignoreClass:"ignore-orphan"};a[c]={deorphanize:b.deorphanize};var d=a.typographer_common,g=a.fn[c].entities})(jQuery,window,document);(function(a){var c;function b(e,b){this.context=e;this.$context=a(e);this.options=a.extend({},a.fn[c].defaults,b);this.init()}function h(e,b){var c=a.grep(e.split(/\s+|[.?!,;:"'-()]+/),function(a){return a.length>=b.minWordLength});return a.unique(c)}c=void 0;c="typographer_hyphen";b.prototype.init=function(){this.options.ignoreTags=d.normalizeTagNames(this.options.ignoreTags);this.$context.addClass(this.options.contextClass);b.trie=b.trie||[];b.trie[this.options.lang]||this.rebuildTrie(this.options.lang); 28this.execute()};b.prototype.execute=function(){var b=d.getTextNodesIn(this.context,!1),c=this;a.each(b,function(){if(d.shouldIgnore(this,c.context,c.options))return!0;this.nodeValue=c.hyphenate(this.nodeValue)})};b.prototype.splitWord=function(a){return b.splitWord(a,this.options)};b.prototype.hyphenate=function(a){return b.hyphenate(a,this.options)};
28b.prototype.rebuildTrie=function(e){var g=a.fn[c].patterns[e];if(g){for(var d=b.trie,m={},f,n=0;n<g.length;n++){f=g[n];var k=f.replace(/\d/g,""),i;i= 29f;f=[];if(1=="ze4p".split(/\D/).length){i=i.split("");for(var l=void 0,j=0,l=!1;j<i.length;)l=i[j],~~l?(f.push(l),j+=2,l=!0):(f.push(0),j+=1,l=!1);l||f.push(0)}else{f=i.split(/\D/);for(i=0;i<f.length;++i)f[i]=f[i]||"0"}i=f;f=m;for(j=0;j<k.length;j++){var l=k.charAt(j),h=f[l];f=null==h?f[l]=j===k.length-1?{$:i}:{}:0===h?f[l]={$:i}:f[l]}}d[e]=m}else a.error('Hyphenation patterns for language "'+e+'" are undefined')};b.splitWord=function(e,g){g=a.extend({},a.fn[c].defaults,g);if(e.length<g.minWordLength)return[e]; 30if(a.fn.typographer_hyphen.patterns.exceptions[g.lang][e])return a.fn.typographer_hyphen.patterns.exceptions[g.lang][e];for(var d=b.trie[g.lang],m="."+e+".",f=m.length,n=Array(f);0<=--f;)n[f]=0;for(f=0;f<m.length;f++)for(var k=d,i=m.slice(f),l=0;l<i.length;l++){var j=i.charAt(l);if(null!=k[j]){if(k=k[j],k.hasOwnProperty("$"))for(var j=k.$,h=0,q=n.length;h<j.length;h++)f+h>q-1||(n[f+h]=Math.max(n[f+h],j[h]))}else break}for(d=0;d<=g.minLeft;d++)n[d]=0;d=1;for(m=n.length;d<=g.minRight;d++)n[m-d]=0;d= 31[];m="";f=e.split("");for(k=0;k<e.length;k++)i=n[k+2],m+=f[k],1==i%2&&(d.push(m),m="");d.push(m);return d};b.hyphenate=function(b,o){var o=a.extend({},a.fn[c].defaults,o),p=h(b,o);a.each(p,function(h,f){var n=a[c].splitWord(f,o).join(g.shy),k=RegExp(d.quoteRegex(f),"g");b=b.replace(k,n)});return b};a.fn[c]=function(g){return this.each(function(){a.data(this,c)||a.data(this,c,new b(this,g))})};a.fn[c].entities={shy:"\u00ad"};a.fn[c].defaults={contextClass:"jquery-typographer-hyphen",lang:"pl",minWordLength:3, 32minLeft:2,minRight:2,ignoreTags:["pre","code"],ignoreClass:"ignore-hyphen"};a[c]={splitWord:b.splitWord,hyphenate:b.hyphenate};var d=a.typographer_common,g=a.fn[c].entities})(jQuery,window,document);(function(a){var c;function b(b,d){this.context=b;this.$context=a(b);this.options=a.extend({},a.fn[c].defaults,d);this.init()}c=void 0;c="typographer_punctuation";b.prototype.init=function(){this.options.ignoreTags=h.normalizeTagNames(this.options.ignoreTags);this.$context.addClass(this.options.contextClass);this.execute()};b.prototype.execute=function(){var c=h.getTextNodesIn(this.context,!1),d=this;a.each(c,function(){if(h.shouldIgnore(this,d.context,d.options))return!0;var c=this.nodeValue;-1< 33a.inArray("quotes",d.options.correction)&&(c=b.correctQuotes(c));-1<a.inArray("ellipsis",d.options.correction)&&(c=b.correctEllipsis(c));-1<a.inArray("apostrophe",d.options.correction)&&(c=b.correctApostrophe(c));-1<a.inArray("dash",d.options.correction)&&(c=b.correctDash(c));this.nodeValue=c})};b.correctQuotes=function(a){var a=a.replace(/(\s|^)"(\S)/gi,"$1"+d.bdquo+"$2"),a=a.replace(/(\S)"(\s|$|[.,?!;:])/gi,"$1"+d.rdquo+"$2"),b=RegExp("([a-z\u0105\u0107\u0119\u0142\u0144\u00f3\u015b\u017c\u017a0-9])"+ 34d.laquo,"gi"),a=a.replace(RegExp(d.raquo+"([a-z\u0105\u0107\u0119\u0142\u0144\u00f3\u015b\u017c\u017a0-9])","gi"),d.laquo+"$1");return a=a.replace(b,"$1"+d.raquo)};b.correctEllipsis=function(a){return a=a.replace(/\.\.\./gi,d.hellip)};b.correctApostrophe=function(a){return a=a.replace(/'/gi,d.rsquo)};b.correctDash=function(a){a=a.replace(/(\d)\s*-\s*(\d)/gi,"$1"+d.ndash+"$2");a=a.replace(/(\d)\s+(?:\u2012|\u2013)\s+(\d)/gi,"$1"+d.ndash+"$2");a=a.replace(/\s+-\s+/gi," "+d.ndash+" ");return a=a.replace(/([a-z\u0105\u0107\u0119\u0142\u0144\u00f3\u015b\u017c\u017a])(?:\u2012|\u2013)([a-z\u0105\u0107\u0119\u0142\u0144\u00f3\u015b\u017c\u017a])/gi, 35"$1-$2")};a.fn[c]=function(d){return this.each(function(){a.data(this,c)||a.data(this,c,new b(this,d))})};a.fn[c].entities={bdquo:"\u201e",rdquo:"\u201d",laquo:"\u00ab",raquo:"\u00bb",hellip:"\u2026",rsquo:"\u2019",ndash:"\u2013",mdash:"\u2014"};a.fn[c].defaults={correction:["quotes","ellipsis","dash","apostrophe"],contextClass:"jquery-typographer-punctuation",ignoreTags:["pre","code"],ignoreClass:"ignore-punctuation"};a[c]={correctQuotes:b.correctQuotes,correctEllipsis:b.correctEllipsis,correctDash:b.correctDash, 36correctApostrophe:b.correctApostrophe};var h=a.typographer_common,d=a.fn[c].entities})(jQuery,window,document);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.