aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorNicolas LÅ“uillet <nicolas@loeuillet.org>2016-09-02 10:27:41 +0200
committerGitHub <noreply@github.com>2016-09-02 10:27:41 +0200
commit336262e6ee9c57437793a06fb416206ac73a1702 (patch)
treeca9f9312d0b52828a2d12a95fe7f5dd2fc138b7a
parent33adf8dc915f4911fd454e98194c1b2323514d4a (diff)
parenta8d5aa1c44c3349a9271e5f0bc3cb5154d6505d9 (diff)
downloadwallabag-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
-rw-r--r--Gruntfile.js1
-rwxr-xr-xapp/Resources/static/themes/material/css/main.css2
-rw-r--r--package.json1
-rw-r--r--src/Wallabag/CoreBundle/Resources/public/themes/material/js/jquery.tinydot.js103
-rw-r--r--src/Wallabag/CoreBundle/Resources/public/themes/material/js/jquery.tinydot.min.js1
-rw-r--r--src/Wallabag/CoreBundle/Resources/views/themes/material/layout.html.twig4
6 files changed, 4 insertions, 108 deletions
diff --git a/Gruntfile.js b/Gruntfile.js
index c7419549..8dc5b83b 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -45,6 +45,7 @@ module.exports = function (grunt) {
45 src: [ 45 src: [
46 '<%= appDir %>/themes/material/js/init.js', 46 '<%= appDir %>/themes/material/js/init.js',
47 '<%= appDir %>/themes/_global/js/restoreScroll.js', 47 '<%= appDir %>/themes/_global/js/restoreScroll.js',
48 'node_modules/jquery.tinydot/src/jquery.tinydot.js',
48 ], 49 ],
49 dest: '<%= buildDir %>/material.js', 50 dest: '<%= buildDir %>/material.js',
50 }, 51 },
diff --git a/app/Resources/static/themes/material/css/main.css b/app/Resources/static/themes/material/css/main.css
index d3cd1244..dbae5faf 100755
--- a/app/Resources/static/themes/material/css/main.css
+++ b/app/Resources/static/themes/material/css/main.css
@@ -257,7 +257,7 @@ nav input {
257 display: none; 257 display: none;
258} 258}
259 259
260input-field.nav-panel-add, .input-field.nav-panel-add form { 260.input-field.nav-panel-add, .input-field.nav-panel-add form {
261 height: 100%; 261 height: 100%;
262} 262}
263 263
diff --git a/package.json b/package.json
index 3ed7a49f..39a10e9c 100644
--- a/package.json
+++ b/package.json
@@ -28,6 +28,7 @@
28 "jquery": "^2.2.1", 28 "jquery": "^2.2.1",
29 "jquery-ui": "^1.10.5", 29 "jquery-ui": "^1.10.5",
30 "jquery.cookie": "^1.4.1", 30 "jquery.cookie": "^1.4.1",
31 "jquery.tinydot": "^0.2.1",
31 "load-grunt-tasks": "^3.4.1", 32 "load-grunt-tasks": "^3.4.1",
32 "materialize-css": "0.97.5", 33 "materialize-css": "0.97.5",
33 "npm": "^3.8.3", 34 "npm": "^3.8.3",
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
91jQuery(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 %}