Skip to content

Commit

Permalink
truncate to node
Browse files Browse the repository at this point in the history
  • Loading branch information
FrDH committed Jan 18, 2018
1 parent 80bed45 commit 4871b65
Show file tree
Hide file tree
Showing 6 changed files with 135 additions and 114 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name" : "jQuery.dotdotdot",
"version" : "3.2.0",
"version" : "3.2.1",
"main" : "dist/jquery.dotdotdot.js",
"authors" : "Fred Heusschen <[email protected]>",
"license" : "CC-BY-NC-4.0",
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name" : "jQuery.dotdotdot",
"version" : "3.2.0",
"version" : "3.2.1",
"authors" : "Fred Heusschen <[email protected]>",
"license" : "CC-BY-NC-4.0",
"description" : "Dotdotdot is an advanced jQuery plugin for truncating multiple line content with an ellipsis.",
Expand Down
4 changes: 2 additions & 2 deletions dist/jquery.dotdotdot.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 21 additions & 11 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -143,34 +143,39 @@ <h3>Toggle full story</h3>
</div>


<script type="text/javascript" src="http://code.jquery.com/jquery-3.2.1.js"></script>
<script type="text/javascript" src="dist/jquery.dotdotdot.js"></script>
<script type="text/javascript">
<script src="http://code.jquery.com/jquery-3.2.1.js"></script>
<script src="dist/jquery.dotdotdot.js"></script>
<script>
$(function() {

// Basic example
/*
Basic example
*/
$('#xmpl-1').dotdotdot({

// Prevents the <a class="read-more" /> from being removed
keep: '.read-more'
});


// Truncate to readable pathnames example

/*
Truncate to readable pathnames example
*/
$('#xmpl-2')
.find( 'li' )
.each(
function()
{
var $t = $(this);

// Wrap each folde in a <span />
// Wrap each folder in a <span />
$t.html( '<span>' + $t.html().split( '/' ).join( '</span><span>/' ) + '</span>' );

// Add the class "file" to the last
// Add the class "file" to the last <span />
$t.children().last().addClass( 'file' );

$(this).dotdotdot({
$t.dotdotdot({

// Add a slash before the ellipsis
ellipsis: '/\u2026',
Expand All @@ -182,7 +187,10 @@ <h3>Toggle full story</h3>
);


// Toggle full story example

/*
Toggle full story example
*/
var $xmpl = $('#xmpl-3');
$xmpl.dotdotdot({

Expand Down Expand Up @@ -220,8 +228,9 @@ <h3>Toggle full story</h3>




// For the demos
/*
For the demos
*/
$('body').on(
'click',
'a[href^="#/"]',
Expand All @@ -232,6 +241,7 @@ <h3>Toggle full story</h3>
}
);


});
</script>
</body>
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name" : "jquery.dotdotdot",
"version" : "3.2.0",
"version" : "3.2.1",
"main" : "dist/jquery.dotdotdot.js",
"author" : "Fred Heusschen <[email protected]>",
"license" : "CC-BY-NC-4.0",
Expand Down
Loading

0 comments on commit 4871b65

Please sign in to comment.