aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorThomas Citharel <tcit@tcit.fr>2016-08-25 15:55:30 +0200
committerGitHub <noreply@github.com>2016-08-25 15:55:30 +0200
commitbf0d9ef534d7deb2a8de5e74fd436c49bdd53a61 (patch)
tree33430bddcc460f1fa80865b86615461f705368a2
parentc6d77eaf518ad8ca48c84524b9751417a2a19df1 (diff)
parent538587855a72be5b49962132b976816295a05ebc (diff)
downloadwallabag-bf0d9ef534d7deb2a8de5e74fd436c49bdd53a61.tar.gz
wallabag-bf0d9ef534d7deb2a8de5e74fd436c49bdd53a61.tar.zst
wallabag-bf0d9ef534d7deb2a8de5e74fd436c49bdd53a61.zip
Merge pull request #2238 from modos189/v2-improve-view
V2 improve view
-rwxr-xr-xsrc/Wallabag/CoreBundle/Resources/public/themes/material/css/main.css1
-rw-r--r--src/Wallabag/CoreBundle/Resources/public/themes/material/js/jquery.tinydot.js94
-rw-r--r--src/Wallabag/CoreBundle/Resources/public/themes/material/js/jquery.tinydot.min.js2
-rw-r--r--src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entries.html.twig2
-rw-r--r--src/Wallabag/UserBundle/Resources/views/Security/login.html.twig2
5 files changed, 83 insertions, 18 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 eb4eebd8..541096be 100755
--- a/src/Wallabag/CoreBundle/Resources/public/themes/material/css/main.css
+++ b/src/Wallabag/CoreBundle/Resources/public/themes/material/css/main.css
@@ -52,6 +52,7 @@ body {
52 52
53body.login main { 53body.login main {
54 padding: 0; 54 padding: 0;
55 min-height: 100vh;
55} 56}
56 57
57.border-bottom { 58.border-bottom {
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
index d2bf7fb6..bf9eadef 100644
--- a/src/Wallabag/CoreBundle/Resources/public/themes/material/js/jquery.tinydot.js
+++ b/src/Wallabag/CoreBundle/Resources/public/themes/material/js/jquery.tinydot.js
@@ -1,14 +1,14 @@
1/* 1/*
2 * jQuery tinydot 0.1 2 * jQuery tinydot 0.2.0
3 * 3 *
4 * Copyright (c) Alexander Danilov 4 * Copyright (c) Alexander Danilov
5 * www.modos189.ru 5 * modos189.ru
6 * 6 *
7 * Plugin repository: 7 * Plugin website:
8 * https://gitlab.com/modos189/tinydot 8 * tinydot.modos189.ru
9 * 9 *
10 * Licensed under the MIT license. 10 * Licensed under the MIT license.
11 * http://en.wikipedia.org/wiki/MIT_License 11 * http://en.wikipedia.org/wiki/MIT_License
12 */ 12 */
13 13
14(function( $, undef ) 14(function( $, undef )
@@ -19,21 +19,85 @@
19 } 19 }
20 20
21 $.fn.tinydot = function( o ) { 21 $.fn.tinydot = function( o ) {
22 var p=$(this).children('a'); 22
23 var divh=$(this).height(); 23 var $dot = this;
24 while ($(p).outerHeight()>divh) { 24 $dot.child = getChildOrDie($dot);
25 $(p).text(function (index, text) { 25 $dot.orgContent = $($dot.child).html();
26 return text.replace(/\W*\s(\S)*$/, '...'); 26 ellipsis( $dot );
27
28 $dot.watch = function()
29 {
30 $(window).on('resize', function(){
31 if ( watchInt )
32 {
33 clearInterval( watchInt );
34 }
35 watchInt = setTimeout(
36 function()
37 {
38 reinitialize($dot);
39 }, 100
40 );
27 }); 41 });
42
43 return $dot;
44 };
45
46 var opts = $.extend( true, {}, $.fn.tinydot.defaults, o ),
47 watchInt = null;
48
49 if ( opts.watch )
50 {
51 $dot.watch();
28 } 52 }
29 } 53 }
54
55 // public
56 $.fn.tinydot.defaults = {
57 'watch' : false
58 };
59
60 function getChildOrDie( $elem )
61 {
62 var childrens = $elem.children();
63 if (childrens.length == 0) {
64 // create children
65 var data = $($elem).html();
66 $elem.html('');
67 $elem.append('<span />');
68 return $elem.children('span').html(data);
69 } else {
70 return childrens[0];
71 }
72 }
73
74 function reinitialize( $elem )
75 {
76 $($elem.child).html($elem.orgContent);
77 ellipsis( $elem );
78 }
79
80 function ellipsis( $elem ) {
81 var divh=$($elem).height();
82 while ($($elem.child).outerHeight()>divh) {
83 $($elem.child).html(function (index, html) {
84 return html.replace(/\W*\s(\S)*$/, '...');
85 });
86 }
87 }
88
30})( jQuery ); 89})( jQuery );
31 90
32jQuery(document).ready(function($) { 91jQuery(document).ready(function($) {
33 //We only invoke jQuery.tinydot on elements that have dot-ellipsis class 92 //We only invoke jQuery.tinydot on elements that have dot-ellipsis class
34 $(".dot-ellipsis").each(function(){ 93 $(".dot-ellipsis").each(function(){
35 var x = new Object(); 94 //Checking if update on window resize required
36 $(this).tinydot(x); 95 var watch_window=$(this).hasClass("dot-resize-update");
96
97 //Invoking jQuery.tinydot
98 var x = new Object();
99 if (watch_window)
100 x.watch='window';
101 $(this).tinydot(x);
37 }); 102 });
38
39}); 103});
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
index 32c5799f..74754629 100644
--- 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
@@ -1 +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)})}); !function(a,b){function c(b){var c=b.children();if(0==c.length){var d=a(b).html();return b.html(""),b.append("<span />"),b.children("span").html(d)}return c[0]}function d(b){a(b.child).html(b.orgContent),e(b)}function e(b){for(var c=a(b).height();a(b.child).outerHeight()>c;)a(b.child).html(function(a,b){return b.replace(/\W*\s(\S)*$/,"...")})}a.fn.tinydot||(a.fn.tinydot=function(b){var f=this;f.child=c(f),f.orgContent=a(f.child).html(),e(f),f.watch=function(){return a(window).on("resize",function(){h&&clearInterval(h),h=setTimeout(function(){d(f)},100)}),f};var g=a.extend(!0,{},a.fn.tinydot.defaults,b),h=null;g.watch&&f.watch()},a.fn.tinydot.defaults={watch:!1})}(jQuery),jQuery(document).ready(function(a){a(".dot-ellipsis").each(function(){var b=a(this).hasClass("dot-resize-update"),c=new Object;b&&(c.watch="window"),a(this).tinydot(c)})});
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 2110b889..f6941ca5 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 dot-ellipsis"><a href="{{ path('view', { 'id': entry.id }) }}" title="{{ entry.title|raw }}">{{ entry.title|striptags|raw }}</a></span> 38 <span class="card-title dot-ellipsis dot-resize-update"><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/UserBundle/Resources/views/Security/login.html.twig b/src/Wallabag/UserBundle/Resources/views/Security/login.html.twig
index 982a33b2..5835330d 100644
--- a/src/Wallabag/UserBundle/Resources/views/Security/login.html.twig
+++ b/src/Wallabag/UserBundle/Resources/views/Security/login.html.twig
@@ -39,7 +39,7 @@
39 <i class="mdi-content-send right"></i> 39 <i class="mdi-content-send right"></i>
40 </button> 40 </button>
41 </div> 41 </div>
42 <div class="center"> 42 <div class="row center">
43 <a href="{{ path('fos_user_resetting_request') }}">{{ 'security.login.forgot_password'|trans }}</a> 43 <a href="{{ path('fos_user_resetting_request') }}">{{ 'security.login.forgot_password'|trans }}</a>
44 </div> 44 </div>
45</form> 45</form>