+
+ // public
+ $.fn.tinydot.defaults = {
+ 'watch' : false
+ };
+
+ function getChildOrDie( $elem )
+ {
+ var childrens = $elem.children();
+ if (childrens.length == 0) {
+ // create children
+ var data = $($elem).html();
+ $elem.html('');
+ $elem.append('<span />');
+ return $elem.children('span').html(data);
+ } else {
+ return childrens[0];
+ }
+ }
+
+ function reinitialize( $elem )
+ {
+ $($elem.child).html($elem.orgContent);
+ ellipsis( $elem );
+ }
+
+ function ellipsis( $elem ) {
+ var divh=$($elem).height();
+ while ($($elem.child).outerHeight()>divh) {
+ $($elem.child).html(function (index, html) {
+ return html.replace(/\W*\s(\S)*$/, '...');
+ });
+ }
+ }
+