diff --git a/lib/cufon.js b/lib/cufon.js index b78f16ce..77beb216 100644 --- a/lib/cufon.js +++ b/lib/cufon.js @@ -4,38 +4,38 @@ */ var Cufon = (function() { - - var api = function() { + + var api = function() { return api.replace.apply(null, arguments); }; - + var DOM = api.DOM = { - + ready: (function() { - + var complete = false, readyStatus = { loaded: 1, complete: 1 }; - + var queue = [], perform = function() { if (complete) return; complete = true; for (var fn; fn = queue.shift(); fn()); }; - + // Gecko, Opera, WebKit r26101+ - + if (fabric.document.addEventListener) { fabric.document.addEventListener('DOMContentLoaded', perform, false); fabric.window.addEventListener('pageshow', perform, false); // For cached Gecko pages } - + // Old WebKit, Internet Explorer - + if (!fabric.window.opera && fabric.document.readyState) (function() { readyStatus[fabric.document.readyState] ? perform() : setTimeout(arguments.callee, 10); })(); - + // Internet Explorer - + if (fabric.document.readyState && fabric.document.createStyleSheet) (function() { try { fabric.document.body.doScroll('left'); @@ -45,39 +45,39 @@ var Cufon = (function() { setTimeout(arguments.callee, 1); } })(); - + addEvent(fabric.window, 'load', perform); // Fallback - + return function(listener) { if (!arguments.length) perform(); else complete ? listener() : queue.push(listener); }; - + })() - + }; var CSS = api.CSS = { - + Size: function(value, base) { - + this.value = parseFloat(value); this.unit = String(value).match(/[a-z%]*$/)[0] || 'px'; - + this.convert = function(value) { return value / base * this.value; }; - + this.convertFrom = function(value) { return value / this.value * base; }; - + this.toString = function() { return this.value + this.unit; }; }, - + getStyle: function(el) { return new Style(el.style); /* @@ -87,7 +87,7 @@ var Cufon = (function() { return new Style(el.style); */ }, - + quotedList: cached(function(value) { // doesn't work properly with empty quoted strings (""), but // it's not worth the extra code. @@ -95,22 +95,22 @@ var Cufon = (function() { while (match = re.exec(value)) list.push(match[3] || match[1]); return list; }), - + ready: (function() { - + var complete = false; - + var queue = [], perform = function() { complete = true; for (var fn; fn = queue.shift(); fn()); }; - + // Safari 2 does not include