jeffchan / truncate.js

fast, intelligent javascript text truncation
MIT License
98 stars 45 forks source link

Truncation at left or middle of the text #15

Closed Tuizi closed 8 years ago

Tuizi commented 8 years ago

I would like to add those features:

Text: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque eget."

I don't thing the "More/Less" button feature is useful in this case.

What do you think?

rogeriotaques commented 8 years ago

+1 More flexibility for text truncate would be perfect to cover many cases. :)

Tuizi commented 8 years ago

I'm currently working on it, only the "middle" case remains....

rogeriotaques commented 8 years ago

@Tuizi cool man!

Any idea about when you'll have it done? I'm currently using a another plugin on a project I'm leading, just because I need the ellipse before the text (on left).

Further, I'd suggest you to make truncate.js identify automatically the lineHeight property, instead of require it to be given over options, if possible. I would be a lot more simple to just call $('.something').truncate().

What do you think?

Tuizi commented 8 years ago

I can't promise, but maybe before the end of this week :)

For the automatic lineHeight property, yes I could definitively do that.

rogeriotaques commented 8 years ago

@Tuizi thanks a lot! Good job, btw. ;)

Tuizi commented 8 years ago

@rogeriotaques Still working on it, take me more time than expected :)

rogeriotaques commented 8 years ago

@Tuizi no worries. Take your time. :+1:

Tuizi commented 8 years ago

Code review in progress, this feature will be in version 1.1 with some limitations and with auto detection of lineHeight

rogeriotaques commented 8 years ago

@Tuizi great! Glad to know. :+1:

I'm just about to fix some issues with the one I'm using now, if review doesn't take so long, I can replace the current by truncate.js. Looking forward to see how it goes. :)

Thanks.

Tuizi commented 8 years ago

I'm waiting for @jeffchan to approve my PR. If he can't (doesn't actively working on this library any more), I will merge the PR myself.

Next little PR and feature that will create the version 1.1 is the auto lineHeight detection

jeffchan commented 8 years ago

Apologies for the delay. I will take a look today.

Tuizi commented 8 years ago

Feature added with #20 Will be available in truncate.js version 1.1

rogeriotaques commented 8 years ago

Good job guys! Thank you very much! Let me test it and I let you know any update. 👍

rogeriotaques commented 8 years ago

@Tuizi good job. It's working nicely. 👍 👍 👍

Tuizi commented 8 years ago

Thank. Don't hesitate to add issues when you find some and/or ask for features