diff options
author | Nicolas LÅ“uillet <nicolas@loeuillet.org> | 2016-08-23 17:24:46 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-08-23 17:24:46 +0200 |
commit | 2f9927404d620f719d4b30d9205ff43c0238e6a1 (patch) | |
tree | 67c7a07fb012b8c0b0068f9cbcd2aee049aa5a5e /src/Wallabag | |
parent | d5de909bbc2c757e749e91c6638cddf8b29f92bd (diff) | |
parent | 28388e15c38290ba920849883c91f827a257cb50 (diff) | |
download | wallabag-2f9927404d620f719d4b30d9205ff43c0238e6a1.tar.gz wallabag-2f9927404d620f719d4b30d9205ff43c0238e6a1.tar.zst wallabag-2f9927404d620f719d4b30d9205ff43c0238e6a1.zip |
Merge pull request #2230 from modos189/issue_2055
Cut entries title in card view: continued
Diffstat (limited to 'src/Wallabag')
5 files changed, 48 insertions, 1 deletions
diff --git a/src/Wallabag/CoreBundle/Resources/public/themes/material/css/main.css b/src/Wallabag/CoreBundle/Resources/public/themes/material/css/main.css index b4e082d3..eb4eebd8 100755 --- a/src/Wallabag/CoreBundle/Resources/public/themes/material/css/main.css +++ b/src/Wallabag/CoreBundle/Resources/public/themes/material/css/main.css | |||
@@ -285,6 +285,12 @@ main ul.row { | |||
285 | 285 | ||
286 | .card .card-content .card-title { | 286 | .card .card-content .card-title { |
287 | line-height: 32px; | 287 | line-height: 32px; |
288 | max-height: 64px; | ||
289 | display: block; | ||
290 | } | ||
291 | |||
292 | .card .card-content i.right, .card .card-reveal i.right { | ||
293 | margin-left: 0; | ||
288 | } | 294 | } |
289 | 295 | ||
290 | .card .card-content .estimatedTime { | 296 | .card .card-content .estimatedTime { |
diff --git a/src/Wallabag/CoreBundle/Resources/public/themes/material/js/jquery.tinydot.js b/src/Wallabag/CoreBundle/Resources/public/themes/material/js/jquery.tinydot.js new file mode 100644 index 00000000..d2bf7fb6 --- /dev/null +++ b/src/Wallabag/CoreBundle/Resources/public/themes/material/js/jquery.tinydot.js | |||
@@ -0,0 +1,39 @@ | |||
1 | /* | ||
2 | * jQuery tinydot 0.1 | ||
3 | * | ||
4 | * Copyright (c) Alexander Danilov | ||
5 | * www.modos189.ru | ||
6 | * | ||
7 | * Plugin repository: | ||
8 | * https://gitlab.com/modos189/tinydot | ||
9 | * | ||
10 | * Licensed under the MIT license. | ||
11 | * http://en.wikipedia.org/wiki/MIT_License | ||
12 | */ | ||
13 | |||
14 | (function( $, undef ) | ||
15 | { | ||
16 | if ( $.fn.tinydot ) | ||
17 | { | ||
18 | return; | ||
19 | } | ||
20 | |||
21 | $.fn.tinydot = function( o ) { | ||
22 | var p=$(this).children('a'); | ||
23 | var divh=$(this).height(); | ||
24 | while ($(p).outerHeight()>divh) { | ||
25 | $(p).text(function (index, text) { | ||
26 | return text.replace(/\W*\s(\S)*$/, '...'); | ||
27 | }); | ||
28 | } | ||
29 | } | ||
30 | })( jQuery ); | ||
31 | |||
32 | jQuery(document).ready(function($) { | ||
33 | //We only invoke jQuery.tinydot on elements that have dot-ellipsis class | ||
34 | $(".dot-ellipsis").each(function(){ | ||
35 | var x = new Object(); | ||
36 | $(this).tinydot(x); | ||
37 | }); | ||
38 | |||
39 | }); | ||
diff --git a/src/Wallabag/CoreBundle/Resources/public/themes/material/js/jquery.tinydot.min.js b/src/Wallabag/CoreBundle/Resources/public/themes/material/js/jquery.tinydot.min.js new file mode 100644 index 00000000..32c5799f --- /dev/null +++ b/src/Wallabag/CoreBundle/Resources/public/themes/material/js/jquery.tinydot.min.js | |||
@@ -0,0 +1 @@ | |||
!function(t,n){t.fn.tinydot||(t.fn.tinydot=function(n){for(var e=t(this).children("a"),i=t(this).height();t(e).outerHeight()>i;)t(e).text(function(t,n){return n.replace(/\W*\s(\S)*$/,"...")})})}(jQuery),jQuery(document).ready(function(t){t(".dot-ellipsis").each(function(){var n=new Object;t(this).tinydot(n)})}); | |||
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entries.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entries.html.twig index c8e4a533..2110b889 100644 --- a/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entries.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entries.html.twig | |||
@@ -35,7 +35,7 @@ | |||
35 | <i class="card-title grey-text text-darken-4 activator mdi-navigation-more-horiz right"></i> | 35 | <i class="card-title grey-text text-darken-4 activator mdi-navigation-more-horiz right"></i> |
36 | {% endif %} | 36 | {% endif %} |
37 | 37 | ||
38 | <span class="card-title"><a href="{{ path('view', { 'id': entry.id }) }}" title="{{ entry.title|raw }}">{{ entry.title|striptags|slice(0, 42)|raw }}</a></span> | 38 | <span class="card-title dot-ellipsis"><a href="{{ path('view', { 'id': entry.id }) }}" title="{{ entry.title|raw }}">{{ entry.title|striptags|raw }}</a></span> |
39 | 39 | ||
40 | <div class="estimatedTime grey-text"> | 40 | <div class="estimatedTime grey-text"> |
41 | <span class="tool reading-time"> | 41 | <span class="tool reading-time"> |
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/material/layout.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/material/layout.html.twig index a5c16792..0573e8e5 100644 --- a/src/Wallabag/CoreBundle/Resources/views/themes/material/layout.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/themes/material/layout.html.twig | |||
@@ -11,6 +11,7 @@ | |||
11 | {% block scripts %} | 11 | {% block scripts %} |
12 | {{ parent() }} | 12 | {{ parent() }} |
13 | 13 | ||
14 | <script src="{{ asset('bundles/wallabagcore/themes/material/js/jquery.tinydot.min.js') }}"></script> | ||
14 | <script src="{{ asset('bundles/wallabagcore/themes/material/js/materialize.min.js') }}"></script> | 15 | <script src="{{ asset('bundles/wallabagcore/themes/material/js/materialize.min.js') }}"></script> |
15 | <script src="{{ asset('bundles/wallabagcore/themes/material/js/init.js') }}"></script> | 16 | <script src="{{ asset('bundles/wallabagcore/themes/material/js/init.js') }}"></script> |
16 | {% endblock %} | 17 | {% endblock %} |