From 33cf3205fa6d97bf79d27dfc7afc69dcb1e6e0b7 Mon Sep 17 00:00:00 2001 From: Hadi Nategh Date: Wed, 21 Jan 2015 11:10:17 +0000 Subject: [PATCH] Fix some issues in Expose view: -Fix an error complaing of nm existance(eg.link widget) -Some styling to thumbnail indicator -Add hideControlsOnSlideshow to the blueimp gallery plugin to be able to hide the controls --- etemplate/js/expose.js | 8 +++--- etemplate/templates/default/etemplate2.css | 27 ++++++++++++++++++- .../blueimp/js/jquery.blueimp-gallery.min.js | 2 ++ 3 files changed, 33 insertions(+), 4 deletions(-) diff --git a/etemplate/js/expose.js b/etemplate/js/expose.js index 135669578d..c000231ece 100644 --- a/etemplate/js/expose.js +++ b/etemplate/js/expose.js @@ -67,7 +67,7 @@ function expose (widget) while(nextmatch == null && current) { current = current.getParent(); - if(current.instanceOf(et2_nextmatch)) + if(typeof current !='undefined' && current.instanceOf(et2_nextmatch)) { nextmatch = current; } @@ -104,7 +104,7 @@ function expose (widget) if(data && data.data && data.data.mime && mime_regex.test(data.data.mime)) { var media = this.getMedia(data.data); - images[i] = (jQuery.extend({}, data.data, media[0])); + images.push(jQuery.extend({}, data.data, media[0])); } } @@ -214,6 +214,8 @@ function expose (widget) preloadRange: 2, // The transition speed between slide changes in milliseconds: transitionSpeed: 400, + //Hide controls when the slideshow is playing + hideControlsOnSlideshow: true, // The transition speed for automatic slide changes, set to an integer // greater 0 to override the default transition speed: slideshowTransitionSpeed: undefined, @@ -288,7 +290,7 @@ function expose (widget) var self=this; // If the media type is not supported do not bind the click handler - if (_value && typeof _value.mime != 'undefined' && !_value.mime.match(/^(video|image|audio|media)\//,'ig')) + if (_value && typeof _value.mime != 'undefined' && !_value.mime.match(mime_regex,'ig')) { return; } diff --git a/etemplate/templates/default/etemplate2.css b/etemplate/templates/default/etemplate2.css index a6bfffb57e..1da6a6bed6 100644 --- a/etemplate/templates/default/etemplate2.css +++ b/etemplate/templates/default/etemplate2.css @@ -1755,8 +1755,33 @@ span.et2_egw_action_ddHelper_itemsCnt { */ /* Paginating with nextmatch */ .blueimp-gallery-controls > .indicator.paginating { - max-height: 2em; + border-bottom: 2px solid rgba(255, 255, 255, 0.5); + border-top: 2px solid rgba(255, 255, 255, 0.5); left: 0px; right: auto; white-space: nowrap; +} +/*Carousel thumbnails*/ +.blueimp-gallery>.indicator>li { + display: inline-block; + width: 46px; + height: 46px; + margin: none; + -webkit-box-sizing: content-box; + -moz-box-sizing: content-box; + box-sizing: content-box; + border: 1px solid transparent; + background: #ccc; + background: rgba(255, 255, 255, 0.17)center no-repeat; + border-radius: 5px; + box-shadow: 0 0 2px #000; + opacity: .5; + cursor: pointer; + background-repeat: no-repeat; + margin: 2px; +} +/*Slideshow Play/Pause button*/ +.blueimp-gallery>.play-pause{ + right: 42px; + top: 23px; } \ No newline at end of file diff --git a/phpgwapi/js/jquery/blueimp/js/jquery.blueimp-gallery.min.js b/phpgwapi/js/jquery/blueimp/js/jquery.blueimp-gallery.min.js index 161c1a1683..19236b3e59 100644 --- a/phpgwapi/js/jquery/blueimp/js/jquery.blueimp-gallery.min.js +++ b/phpgwapi/js/jquery/blueimp/js/jquery.blueimp-gallery.min.js @@ -49,6 +49,7 @@ function(a) { unloadElements: !0, startSlideshow: !1, slideshowInterval: 5e3, + hideControlsOnSlideshow:false, index: 0, preloadRange: 2, transitionSpeed: 400, @@ -144,6 +145,7 @@ function(a) { }, play: function(a) { var b = this; + if (this.options.hideControlsOnSlideshow) this.container.removeClass(this.options.controlsClass); window.clearTimeout(this.timeout), this.interval = a || this.options.slideshowInterval, this.elements[this.index] > 1 && (this.timeout = this.setTimeout(!this.requestAnimationFrame && this.slide || function(a, c) { b.animationFrameId = b.requestAnimationFrame.call(window, function() {