Skip to content
Browse files

Update minified rainbow

  • Loading branch information...
1 parent a34468f commit cec01560a301bbc8ae23b33eaa25658c607cc026 @ccampbell committed Mar 27, 2012
Showing with 7 additions and 7 deletions.
  1. +7 −7 js/rainbow.min.js
View
14 js/rainbow.min.js
@@ -1,7 +1,7 @@
-/* Rainbow v1.0 rainbowco.de */
-window.Rainbow=function(){function p(a){var c=a.getAttribute&&a.getAttribute("data-language")||null;if(!c){var a=a.attributes.length,b;for(b=0;b<a;++b)"data-language"==="data-language"[b].nodeName&&(c="data-language"[b].nodeValue)}return c}function B(a,c){for(var b in f[e]){b=parseInt(b,10);if(a==b&&c==f[e][b]?0:a<=b&&c>=f[e][b])delete f[e][b],delete h[e][b];if(a>=b&&a<f[e][b]||c>b&&c<f[e][b])return!0}return!1}function q(a,c){return'<span class="'+a.replace(/\./g," ")+(k?" "+k:"")+'">'+c+"</span>"}
-function C(a,c){var b=a.index,d;for(d=1;d<c;++d)a[d]&&(b+=a[d].length);return b}function r(a,c,b,d){var i=a.exec(b);if(i){++s;var g=i[0],j=i.index,t=i[0].length+j,l=function(){function i(){r(a,c,b,d)}0<s%100?i():setTimeout(i,0)};if(B(j,t))l();else{var m=u(c.matches),k=function(a,b,d){if(a>=b.length)d(g);else{var e=function(){k(++a,b,d)},f=i[b[a]];if(f){var j=c.matches[b[a]],h=j.language;h?v(f,h,function(a){g=g.replace(f,a);e()}):"object"===typeof j?w(f,j.length?j:[j],function(a){g=g.replace(f,a);
-e()}):(g=x(C(i,b[a])-i.index,f,q(j,f),g),e())}else e()}};k(0,m,function(a){c.name&&(a=q(c.name,a));h[e]||(h[e]={},f[e]={});h[e][j]={replace:i[0],"with":a};f[e][j]=t;l()})}}else d()}function D(a){var c=m[a]||[],b=m[y]||[];return z[a]?c:c.concat(b)}function x(a,c,b,d){return d.substr(0,a)+d.substr(a).replace(c,b)}function u(a){var c=[],b;for(b in a)a.hasOwnProperty(b)&&c.push(b);return c.sort(function(a,b){return b-a})}function w(a,c,b){function d(c,g){g<c.length?r(c[g].pattern,c[g],a,function(){d(c,
-++g)}):E(a,function(a){delete h[e];delete f[e];--e;b(a)})}++e;d(c,0)}function E(a,c){function b(a,c,d,f){if(d<c.length){++A;var l=c[d],k=h[e][l],a=x(l,k.replace,k["with"],a),l=function(){b(a,c,++d,f)};0<A%250?l():setTimeout(l,0)}else f(a)}var d=u(h[e]);b(a,d,0,c)}function v(a,c,b){w(a,D(c),function(a){b(a)})}function n(a,c){if(c<a.length){var b=p(a[c])||p(a[c].parentNode);b?(b=b.toLowerCase(),a[c].className=b,v(a[c].innerHTML,b,function(d){a[c].innerHTML=d;h={};f={};o&&o(a[c],b);setTimeout(function(){n(a,
-++c)},0)})):n(a,++c)}}var h={},f={},m={},z={},e=0,y=0,s=0,A=0,k,o;return{extend:function(a,c,b){1==arguments.length&&(c=a,a=y);z[a]=b;m[a]=c.concat(m[a]||[])},c:function(a){o=a},b:function(a){k=a},a:function(){var a=document.getElementsByTagName("pre"),c=document.getElementsByTagName("code"),b,d=[];for(b=c.length>>>0;b--;)d[b]=c[b];for(b=0;b<a.length;++b)a[b].getElementsByTagName("code").length||d.push(a[b]);n(d,0)}}}();
-window.addEventListener?window.addEventListener("load",Rainbow.a,!1):window.attachEvent("onload",Rainbow.a);Rainbow.onHighlight=Rainbow.c;Rainbow.addClass=Rainbow.b;
+/* Rainbow v1.1 rainbowco.de */
+window.Rainbow=function(){function q(a){var b=a.getAttribute&&a.getAttribute("data-language")||null;if(!b){var a=a.attributes.length,c;for(c=0;c<a;++c)"data-language"==="data-language"[c].nodeName&&(b="data-language"[c].nodeValue)}return b}function C(a){a.className+=a.className?" rainbow":"rainbow"}function D(a,b){for(var c in f[d]){c=parseInt(c,10);if(a==c&&b==f[d][c]?0:a<=c&&b>=f[d][c])delete f[d][c],delete h[d][c];if(a>=c&&a<f[d][c]||b>c&&b<f[d][c])return!0}return!1}function r(a,b){return'<span class="'+
+a.replace(/\./g," ")+(k?" "+k:"")+'">'+b+"</span>"}function E(a,b){var c=0,e;for(e=1;e<b;++e)a[e]&&(c+=a[e].length);return c}function s(a,b,c,e){var j=a.exec(c);if(j){++t;!b.name&&b.matches[0]&&(b.name=b.matches[0],delete b.matches[0]);var g=j[0],i=j.index,u=j[0].length+i,l=function(){function j(){s(a,b,c,e)}t%100>0?j():setTimeout(j,0)};if(D(i,u))l();else{var m=v(b.matches),k=function(a,c,e){if(a>=c.length)e(g);else{var d=function(){k(++a,c,e)},f=j[c[a]];if(f){var i=b.matches[c[a]],h=i.language;if(h)n(f,
+h,function(a){g=g.replace(f,a);d()});else if(typeof i==="object")w(f,i.length?i:[i],function(a){g=g.replace(f,a);d()});else{g=x(E(j,c[a]),f,r(i,f),g);d()}}else d()}};k(0,m,function(a){b.name&&(a=r(b.name,a));if(!h[d]){h[d]={};f[d]={}}h[d][i]={replace:j[0],"with":a};f[d][i]=u;l()})}}else e()}function F(a){var b=m[a]||[],c=m[y]||[];return z[a]?b:b.concat(c)}function x(a,b,c,e){return e.substr(0,a)+e.substr(a).replace(b,c)}function v(a){var b=[],c;for(c in a)a.hasOwnProperty(c)&&b.push(c);return b.sort(function(a,
+c){return c-a})}function w(a,b,c){function e(b,g){g<b.length?s(b[g].pattern,b[g],a,function(){e(b,++g)}):G(a,function(a){delete h[d];delete f[d];--d;c(a)})}++d;e(b,0)}function G(a,b){function c(a,b,e,f){if(e<b.length){++A;var l=b[e],k=h[d][l],a=x(l,k.replace,k["with"],a),l=function(){c(a,b,++e,f)};0<A%250?l():setTimeout(l,0)}else f(a)}var e=v(h[d]);c(a,e,0,b)}function n(a,b,c){w(a,F(b),function(a){c(a)})}function o(a,b,c){if(b<a.length){var e=q(a[b])||q(a[b].parentNode);return!(-1<(" "+a[b].className+
+" ").indexOf(" rainbow "))&&e?(e=e.toLowerCase(),C(a[b]),n(a[b].innerHTML,e,function(d){a[b].innerHTML=d;h={};f={};p&&p(a[b],e);setTimeout(function(){o(a,++b,c)},0)})):o(a,++b,c)}c&&c()}function B(a,b){var c=(a||document).getElementsByTagName("pre"),e=(a||document).getElementsByTagName("code"),d,f=[];for(d=0;d<e.length;++d)f.push(e[d]);for(d=0;d<c.length;++d)c[d].getElementsByTagName("code").length||f.push(c[d]);o(f,0,b)}var h={},f={},m={},z={},d=0,y=0,t=0,A=0,k,p;return{extend:function(a,b,c){1==
+arguments.length&&(b=a,a=y);z[a]=c;m[a]=b.concat(m[a]||[])},b:function(a){p=a},a:function(a){k=a},color:function(a,b,c){if("string"==typeof a)return n(a,b,c);if("function"==typeof a)return B(null,a);B(a instanceof Event?null:a,b)}}}();window.addEventListener?window.addEventListener("load",Rainbow.color,!1):window.attachEvent("onload",Rainbow.color);Rainbow.onHighlight=Rainbow.b;Rainbow.addClass=Rainbow.a;Rainbow.color=Rainbow.color;

0 comments on commit cec0156

Please sign in to comment.
Something went wrong with that request. Please try again.