diff options
author | Nicolas LÅ“uillet <nicolas@loeuillet.org> | 2016-09-02 10:27:41 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-09-02 10:27:41 +0200 |
commit | 336262e6ee9c57437793a06fb416206ac73a1702 (patch) | |
tree | ca9f9312d0b52828a2d12a95fe7f5dd2fc138b7a /src | |
parent | 33adf8dc915f4911fd454e98194c1b2323514d4a (diff) | |
parent | a8d5aa1c44c3349a9271e5f0bc3cb5154d6505d9 (diff) | |
download | wallabag-336262e6ee9c57437793a06fb416206ac73a1702.tar.gz wallabag-336262e6ee9c57437793a06fb416206ac73a1702.tar.zst wallabag-336262e6ee9c57437793a06fb416206ac73a1702.zip |
Merge pull request #2252 from wallabag/fix-last-merge
Fixed last merge who caused CSS/JS bugs
Diffstat (limited to 'src')
3 files changed, 1 insertions, 107 deletions
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 deleted file mode 100644 index bf9eadef..00000000 --- a/src/Wallabag/CoreBundle/Resources/public/themes/material/js/jquery.tinydot.js +++ /dev/null | |||
@@ -1,103 +0,0 @@ | |||
1 | /* | ||
2 | * jQuery tinydot 0.2.0 | ||
3 | * | ||
4 | * Copyright (c) Alexander Danilov | ||
5 | * modos189.ru | ||
6 | * | ||
7 | * Plugin website: | ||
8 | * tinydot.modos189.ru | ||
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 | |||
23 | var $dot = this; | ||
24 | $dot.child = getChildOrDie($dot); | ||
25 | $dot.orgContent = $($dot.child).html(); | ||
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 | ); | ||
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(); | ||
52 | } | ||
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 | |||
89 | })( jQuery ); | ||
90 | |||
91 | jQuery(document).ready(function($) { | ||
92 | //We only invoke jQuery.tinydot on elements that have dot-ellipsis class | ||
93 | $(".dot-ellipsis").each(function(){ | ||
94 | //Checking if update on window resize required | ||
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); | ||
102 | }); | ||
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 deleted file mode 100644 index 74754629..00000000 --- a/src/Wallabag/CoreBundle/Resources/public/themes/material/js/jquery.tinydot.min.js +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | !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/layout.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/material/layout.html.twig index 6e95345c..50134357 100644 --- a/src/Wallabag/CoreBundle/Resources/views/themes/material/layout.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/themes/material/layout.html.twig | |||
@@ -7,9 +7,7 @@ | |||
7 | 7 | ||
8 | {% block scripts %} | 8 | {% block scripts %} |
9 | {{ parent() }} | 9 | {{ parent() }} |
10 | <script src="{{ asset('bundles/wallabagcore/themes/material/js/jquery.tinydot.min.js') }}"></script> | 10 | <script src="{{ asset('bundles/wallabagcore/themes/material/js/material.min.js') }}"></script> |
11 | <script src="{{ asset('bundles/wallabagcore/themes/material/js/materialize.min.js') }}"></script> | ||
12 | <script src="{{ asset('bundles/wallabagcore/themes/material/js/init.js') }}"></script> | ||
13 | {% endblock %} | 11 | {% endblock %} |
14 | 12 | ||
15 | {% block header %} | 13 | {% block header %} |