/*! BigText - v0.1.8 - 2015-04-01 * https://github.com/zachleat/bigtext * Copyright (c) 2015 Zach Leatherman (@zachleat) * MIT License */ (function(window,$){"use strict";var counter=0,$headCache=$('head'),oldBigText=window.BigText,oldjQueryMethod=$.fn.bigtext,BigText={DEBUG_MODE:false,DEFAULT_MIN_FONT_SIZE_PX:null,DEFAULT_MAX_FONT_SIZE_PX:528,GLOBAL_STYLE_ID:'bigtext-style',STYLE_ID:'bigtext-id',LINE_CLASS_PREFIX:'bigtext-line',EXEMPT_CLASS:'bigtext-exempt',noConflict:function(restore){if(restore){$.fn.bigtext=oldjQueryMethod;window.BigText=oldBigText}return BigText},supports:{wholeNumberFontSizeOnly:(function(){if(!('getComputedStyle'in window)){return true}var test=$('
').css({position:'absolute','font-size':'14.1px'}).insertBefore($('script').eq(0)),computedStyle=window.getComputedStyle(test[0],null);var ret=computedStyle&&computedStyle.getPropertyValue('font-size')==='14px';test.remove();return ret})()},init:function(){if(!$('#'+BigText.GLOBAL_STYLE_ID).length){$headCache.append(BigText.generateStyleTag(BigText.GLOBAL_STYLE_ID,['.bigtext * { white-space: nowrap; } .bigtext > * { display: block; }','.bigtext .'+BigText.EXEMPT_CLASS+', .bigtext .'+BigText.EXEMPT_CLASS+' * { white-space: normal; }']))}},bindResize:function(eventName,resizeFunction){var timeoutId;$(window).unbind(eventName).bind(eventName,function(){if(timeoutId){clearTimeout(timeoutId)}timeoutId=setTimeout(resizeFunction,100)})},getStyleId:function(id){return BigText.STYLE_ID+'-'+id},generateStyleTag:function(id,css){return $('').attr('id',id)},clearCss:function(id){var styleId=BigText.getStyleId(id);$('#'+styleId).remove()},generateCss:function(id,linesFontSizes,lineWordSpacings,minFontSizes){var css=[];BigText.clearCss(id);for(var j=0,k=linesFontSizes.length;j=maxWidth){$line.css(property,'');if(width===maxWidth){return{match:'exact',size:parseFloat((parseFloat(size)-0.1).toFixed(3))}}var under=maxWidth-previousWidth,over=width-maxWidth;return{match:'estimate',size:parseFloat((parseFloat(size)-(property==='word-spacing'&&previousWidth&&(overmaxFontSize){newFontSize=maxFontSize;break outer}lineMax=testLineDimensions($line,maxWidth,'font-size',newFontSize+j*intervals[m],intervals[m],'px',lineMax);if(typeof lineMax!=='number'){newFontSize=lineMax.size;if(lineMax.match==='exact'){break outer}break inner}}}ratios.push(maxWidth/newFontSize);if(newFontSize>maxFontSize){fontSizes.push(maxFontSize);minFontSizes.push(false)}else if(!!minFontSize&&newFontSize