!function(t,e){if(!t.fn.dotdotdot){t.fn.dotdotdot=function(e){if(0==this.length)return t.fn.dotdotdot.debug('No element found for "'+this.selector+'".'),this;if(this.length>1)return this.each(function(){t(this).dotdotdot(e)});var r=this;r.data("dotdotdot")&&r.trigger("destroy.dot"),r.data("dotdotdot-style",r.attr("style")||""),r.css("word-wrap","break-word"),"nowrap"===r.css("white-space")&&r.css("white-space","normal"),r.bind_events=function(){return r.bind("update.dot",function(e,n){e.preventDefault(),e.stopPropagation(),c.maxHeight="number"==typeof c.height?c.height:function(t){for(var e=t.innerHeight(),n=["paddingTop","paddingBottom"],r=0,o=n.length;r").append(n).contents()),n instanceof t&&(o=n)),(g=r.wrapInner('
').children()).contents().detach().end().append(o.clone(!0)).find("br").replaceWith("
").end().css({height:"auto",width:"auto",border:"none",padding:0,margin:0});var d=!1,f=!1;return h.afterElement&&((d=h.afterElement.clone(!0)).show(),h.afterElement.detach()),i(g,c)&&(f="children"==c.wrap?function(t,e,n){var r=t.children(),o=!1;t.empty();for(var a=0,d=r.length;aT?c=u(x.contents().eq(-1-T),n):(c=u(x,n,!0),T||x.detach()),c&&(h=a(s(c),o),l(c,h),T&&d&&t(c).parent().append(d))}else h=a(g.slice(0,v+1).join(p),o),l(c,h);return!0}(p,r,o,d,c):e(p,r,o,d,c))||(p.detach(),h=!0)),h||c&&c.detach()}});return h}(g,r,g,c,d)),g.replaceWith(g.contents()),g=null,t.isFunction(c.callback)&&c.callback.call(r[0],f,o),h.isTruncated=f,f}).bind("isTruncated.dot",function(t,e){return t.preventDefault(),t.stopPropagation(),"function"==typeof e&&e.call(r[0],h.isTruncated),h.isTruncated}).bind("originalContent.dot",function(t,e){return t.preventDefault(),t.stopPropagation(),"function"==typeof e&&e.call(r[0],o),o}).bind("destroy.dot",function(t){t.preventDefault(),t.stopPropagation(),r.unwatch().unbind_events().contents().detach().end().append(o).attr("style",r.data("dotdotdot-style")||"").data("dotdotdot",!1)}),r},r.unbind_events=function(){return r.unbind(".dot"),r},r.watch=function(){if(r.unwatch(),"window"==c.watch){var e=t(window),n=e.width(),o=e.height();e.bind("resize.dot"+h.dotId,function(){n==e.width()&&o==e.height()&&c.windowResizeFix||(n=e.width(),o=e.height(),p&&clearInterval(p),p=setTimeout(function(){r.trigger("update.dot")},100))})}else f=d(r),p=setInterval(function(){if(r.is(":visible")){var t=d(r);f.width==t.width&&f.height==t.height||(r.trigger("update.dot"),f=t)}},500);return r},r.unwatch=function(){return t(window).unbind("resize.dot"+h.dotId),p&&clearInterval(p),r};var o=r.contents(),c=t.extend(!0,{},t.fn.dotdotdot.defaults,e),h={},f={},p=null,g=null;return c.lastCharacter.remove instanceof Array||(c.lastCharacter.remove=t.fn.dotdotdot.defaultArrays.lastCharacter.remove),c.lastCharacter.noEllipsis instanceof Array||(c.lastCharacter.noEllipsis=t.fn.dotdotdot.defaultArrays.lastCharacter.noEllipsis),h.afterElement=function(e,n){if(!e)return!1;if("string"==typeof e)return!!(e=t(e,n)).length&&e;return!!e.jquery&&e}(c.after,r),h.isTruncated=!1,h.dotId=n++,r.data("dotdotdot",!0).bind_events().trigger("update.dot"),c.watch&&r.watch(),r},t.fn.dotdotdot.defaults={ellipsis:" ... ",wrap:"word",fallbackToLetter:!0,lastCharacter:{},tolerance:0,callback:null,after:null,height:null,watch:!1,windowResizeFix:!0},t.fn.dotdotdot.defaultArrays={lastCharacter:{remove:[" "," ",",",";",".","!","?"],noEllipsis:[]}},t.fn.dotdotdot.debug=function(t){};var n=1,r=t.fn.html;t.fn.html=function(n){return n!=e&&!t.isFunction(n)&&this.data("dotdotdot")?this.trigger("update",[n]):r.apply(this,arguments)};var o=t.fn.text;t.fn.text=function(n){return n!=e&&!t.isFunction(n)&&this.data("dotdotdot")?(n=t("").text(n).html(),this.trigger("update",[n])):o.apply(this,arguments)}}function i(t,e){return t.innerHeight()>e.maxHeight}function a(e,n){for(;t.inArray(e.slice(-1),n.lastCharacter.remove)>-1;)e=e.slice(0,-1);return t.inArray(e.slice(-1),n.lastCharacter.noEllipsis)<0&&(e+=n.ellipsis),e}function d(t){return{width:t.innerWidth(),height:t.innerHeight()}}function l(t,e){t.innerText?t.innerText=e:t.nodeValue?t.nodeValue=e:t.textContent&&(t.textContent=e)}function s(t){return t.innerText?t.innerText:t.nodeValue?t.nodeValue:t.textContent?t.textContent:""}function c(t){do{t=t.previousSibling}while(t&&1!==t.nodeType&&3!==t.nodeType);return t}function u(e,n,r){var o,i=e&&e[0];if(i){if(!r){if(3===i.nodeType)return i;if(t.trim(e.text()))return u(e.contents().last(),n)}for(o=c(i);!o;){if((e=e.parent()).is(n)||!e.length)return!1;o=c(e[0])}if(o)return u(t(o),n)}return!1}}(jQuery);