micjamking / succinct Goto Github PK
View Code? Open in Web Editor NEWA tiny jQuery plugin for truncating multiple lines of text
Home Page: http://mikeking.io/succinct/
License: MIT License
A tiny jQuery plugin for truncating multiple lines of text
Home Page: http://mikeking.io/succinct/
License: MIT License
This might be intentional but providing an option to truncate for the special cases like a string with no spaces be of much useful
Hello,
we have just add Succinct to twittstrap resources list
http://www.twittstrap.com/resources/details/succinct
Under : Components
Regards
Bower is raising the following warnings:
bower succinct#~1.1.0 invalid-meta succinct is missing "main" entry in bower.json
bower succinct#~1.1.0 invalid-meta succinct is missing "ignore" entry in bower.json
The issue is that grunt cannot automatically generate the de js dependencies in a Yoeman environment.
Can you please add the following to bower.json:
"main": "jQuery.succinct.min.js"
Thanks for your contribution
Doesn't seem to work with jQuery 3. Any thoughts or work-arounds? Thank you!
Hi,
Is there any way to destroy succinct? Because I need it just on hover state, so when mouseleave I would like to destroy succinct.
Thanks
Nice plugin!
Playing around with .succinct today - calling it from a javascript media query. As the query sets a smaller .succinct size the textDefault truncates nicely. If the query tries to set a larger .succinct size it appears as if the textDefault is no longer based on the original but rather on the current. As a result, the only way to view a larger truncated length is to refresh the browser.
Seems like you figured this out with the live demo input button. It would be great to have a reset we can call into the .succint plugin that works similarly.
Haven't quite figured that out yet though.
Handy plugin. It would be more usable if the plugin added a title attribute to the element as soon as text gets truncated. The value of the title attribute is the full text (not truncated). This mimics most browser's default behavior (if text gets truncated by CSS): they show a tooltip on hover displaying the full text string.
Hello,
Im trying to use your great plugin on links. For example if one client have uploaded a file that has a very long name then my application will create a link with a very long text that the end user needs to click in order to open the file.
I would like to use your plugin to shorten that text with "..." but it does seem to work on Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum
What am i doing wrong?
Code im using is
$('.fileLink').succinct({
size: 120
});
Best Regards Ivan
It would be nice to be able to show how many characters are allowed, and how many characters remain available. For example, someone would be typing in a textbox to leave a comment, and it would be useful to limit the characters in their comment.
I really like the plugin as a matter of fact I will be using for my next project. I realized that succinct only truncates the desired text it doesn't a read more link that can allow readers finish reading the article. I do like to mention that I av not fully checked it out so if the read more function is already there please ignore else please update. Thanks.
Hi. How to write another size for tablets? F.e. for desktop I use 205 charrachters. For tablets I need 120 charachters.
I would love to see a truncate of text without space.
Something like a url can be very long. I have a table with logs and some urls are too long, currently I just get "..." but I would like to see "/home?something=sldvjhsljk..."
Is there some way to truncate by container height?
Hey nice plugin, I was looking over the source code and there does not seem to be any inherent dependency on jquery, so I was wondering if it would be possible to just remove the jquery bits and use normal DOM objects for the element interactions and make a KnockoutJS plugin version?
If you don't want to but dont mind me copying and editing your code I would be happy to make it myself :)
So you could do something like:
<p data-bind="text: Description, succinct: 255">blah blah blah</p>
The demo is not working.
Also it would be helpful if the demo indicated which unit the "size" field expects (which I eventually realized is characters, not lines or px height as I would have expected.)
Currently, succinct strips out inline HTML tags. The plugin should recognize html tags, and if the closing tag is past the character count for which the text is being truncated, it needs to add the appropriate closing tag back in.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.