From 3b16ba88feda74e2e641a3f8dd2b84e6ba7556e7 Mon Sep 17 00:00:00 2001 From: Hadi Nategh Date: Thu, 29 Jan 2015 17:24:08 +0000 Subject: [PATCH 01/24] Fix video media content for Expose view --- etemplate/js/et2_widget_vfs.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/etemplate/js/et2_widget_vfs.js b/etemplate/js/et2_widget_vfs.js index c9075ca95b..f8fc17435c 100644 --- a/etemplate/js/et2_widget_vfs.js +++ b/etemplate/js/et2_widget_vfs.js @@ -331,11 +331,10 @@ var et2_vfsMime = expose(et2_valueWidget.extend([et2_IDetachedDOM], { mediaContent = [{ title: _value.name, - type: 'video/*', - sources:[{ - href: base_url + _value.download_url, - type: _value.mime - }] + type: _value.mime, + poster:'', // TODO: Should be changed by correct video thumbnail later + thumbnail:this.egw().mime_icon(_value['mime'], _value['path']) , + href: base_url + _value.download_url, }]; } else From 2eb687775ece977bebc4e7eb3d6f47023f31ba59 Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Thu, 29 Jan 2015 17:48:01 +0000 Subject: [PATCH 02/24] Some updates to pagination - Fix initial load for mixed directories, was leaving holes in the list for first load - Fix unwanted reload for first slide when not paginating caused unfiltered list to be used --- etemplate/js/expose.js | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/etemplate/js/expose.js b/etemplate/js/expose.js index e7fdec50b6..edcd5f4268 100644 --- a/etemplate/js/expose.js +++ b/etemplate/js/expose.js @@ -89,6 +89,7 @@ function expose (widget) var read_from_nextmatch = function(nm, images, start_at) { if(!start_at) start_at = 0; + var image_index = start_at; var stop = Math.max.apply(null,Object.keys(nm.controller._indexMap)); for(var i = start_at; i <= stop; i++) @@ -98,7 +99,7 @@ function expose (widget) // Returning instead of using IMAGE_DEFAULT means we stop as // soon as a hole is found, instead of getting everything that is // available. The gallery can't fill in the holes. - images[i] = IMAGE_DEFAULT; + images[image_index++] = IMAGE_DEFAULT; continue; } var uid = nm.controller._indexMap[i].uid; @@ -107,7 +108,7 @@ function expose (widget) if(data && data.data && data.data.mime && mime_regex.test(data.data.mime)) { var media = this.getMedia(data.data); - images.push(jQuery.extend({}, data.data, media[0])); + images[image_index++] = jQuery.extend({}, data.data, media[0]); } } }; @@ -464,7 +465,8 @@ function expose (widget) expose_onslide: function (gallery, index, slide){ // First let parent try this._super.apply(this, arguments); - + }, + expose_onslideend: function (gallery, index, slide){ // Check to see if we're in a nextmatch, do magic var nm = find_nextmatch(this); if(nm) @@ -476,19 +478,12 @@ function expose (widget) { indicator.animate({left: (gallery.container.width() / 2)-current.left}); } - } - }, - expose_onslideend: function (gallery, index, slide){ - // Check to see if we're in a nextmatch, do magic - var nm = find_nextmatch(this); - if(nm) - { // Check to see if we're near the end, or maybe some pagination // would be good. var total_count = nm.controller._grid.getTotalCount(); // Already at the end, don't bother - if(index == total_count) return; + if(index == total_count -1 || index == 0) return; // Try to determine direction from state of next & previous slides var direction = 1; From 8633eb416e668df42675f74a0baf31f197c7438f Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Thu, 29 Jan 2015 18:04:49 +0000 Subject: [PATCH 03/24] we have to wait a little, to give browser time to same autocomplete values --- phpgwapi/js/jsapi/egw_open.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/phpgwapi/js/jsapi/egw_open.js b/phpgwapi/js/jsapi/egw_open.js index 468eaa7511..fef22bd7e7 100644 --- a/phpgwapi/js/jsapi/egw_open.js +++ b/phpgwapi/js/jsapi/egw_open.js @@ -385,7 +385,10 @@ egw.extend('open', egw.MODULE_WND_LOCAL, function(_egw, _wnd) } else { - _wnd.close(); + // we have to wait a little, to give browser time to same autocomplete values + _wnd.setTimeout(function() { + _wnd.close(); + }, 20); } }, From 21af57059d0d00a7176d2e336cdd9ea6a5d1b71c Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Thu, 29 Jan 2015 18:07:41 +0000 Subject: [PATCH 04/24] Some updates to pagination - Revert part of previous commit, it made things seem slower. --- etemplate/js/expose.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/etemplate/js/expose.js b/etemplate/js/expose.js index edcd5f4268..126be9b66a 100644 --- a/etemplate/js/expose.js +++ b/etemplate/js/expose.js @@ -465,9 +465,6 @@ function expose (widget) expose_onslide: function (gallery, index, slide){ // First let parent try this._super.apply(this, arguments); - }, - expose_onslideend: function (gallery, index, slide){ - // Check to see if we're in a nextmatch, do magic var nm = find_nextmatch(this); if(nm) { @@ -478,6 +475,13 @@ function expose (widget) { indicator.animate({left: (gallery.container.width() / 2)-current.left}); } + } + }, + expose_onslideend: function (gallery, index, slide){ + // Check to see if we're in a nextmatch, do magic + var nm = find_nextmatch(this); + if(nm) + { // Check to see if we're near the end, or maybe some pagination // would be good. var total_count = nm.controller._grid.getTotalCount(); From b193dc0733a8d7a342085c964c1943d877876361 Mon Sep 17 00:00:00 2001 From: Hadi Nategh Date: Fri, 30 Jan 2015 09:30:06 +0000 Subject: [PATCH 05/24] Fix expose view loading for the first time always shows loading icon --- etemplate/js/expose.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/etemplate/js/expose.js b/etemplate/js/expose.js index 126be9b66a..4e386e3086 100644 --- a/etemplate/js/expose.js +++ b/etemplate/js/expose.js @@ -134,9 +134,11 @@ function expose (widget) // Don't bother with adding a default, we just did that if(image.loading) { - $j(gallery.slides[index]) - .addClass(gallery.options.slideLoadingClass) - .removeClass(gallery.options.slideErrorClass); + //Add load class if it's really a slide with error + if (gallery.slidesContainer.find('[data-index="'+index+'"]').hasClass(gallery.options.slideErrorClass)) + $j(gallery.slides[index]) + .addClass(gallery.options.slideLoadingClass) + .removeClass(gallery.options.slideErrorClass); return; } From 8a2bf6a616da859a62343ab2d5331f04d8fcfcdd Mon Sep 17 00:00:00 2001 From: Hadi Nategh Date: Fri, 30 Jan 2015 10:56:15 +0000 Subject: [PATCH 06/24] Fix some issues in expose view: -Make indicator available for the first time load to be abale to calculate the correct active thumbnail position -Make sure the indicators always are arranged in one line --- etemplate/js/expose.js | 8 ++++++++ etemplate/templates/default/etemplate2.css | 4 ++++ 2 files changed, 12 insertions(+) diff --git a/etemplate/js/expose.js b/etemplate/js/expose.js index 4e386e3086..063abc0262 100644 --- a/etemplate/js/expose.js +++ b/etemplate/js/expose.js @@ -473,6 +473,14 @@ function expose (widget) // See if we need to move the indicator var indicator = gallery.container.find('.indicator'); var current = $j('.active',indicator).position(); + if (current.left == 0) + { + //As controlsClass activates indicators, + //we use it to make indicators available for the first time + //which helps to re-calculate the correct position of it, if it's not loaded yet + gallery.container.addClass(this.expose_options.controlsClass); + current = $j('.active',indicator).position(); + } if(current) { indicator.animate({left: (gallery.container.width() / 2)-current.left}); diff --git a/etemplate/templates/default/etemplate2.css b/etemplate/templates/default/etemplate2.css index 7843f8cbcf..1b410f73ed 100644 --- a/etemplate/templates/default/etemplate2.css +++ b/etemplate/templates/default/etemplate2.css @@ -1822,4 +1822,8 @@ span.et2_egw_action_ddHelper_itemsCnt { /*Give room to Carousel indicator when the gallery controls is on*/ .blueimp-gallery-controls>.slides { height:85%; +} +/*indicator bar with controls*/ +.blueimp-gallery-controls>.indicator { + white-space: nowrap; } \ No newline at end of file From e135e0d2eec8f4b3f7eb2946410df9fb71185b97 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Fri, 30 Jan 2015 11:30:47 +0000 Subject: [PATCH 07/24] * Admin: fix not working setting of ACL for account-selection "select-box with primary group and search", data from contains no selection --- admin/js/app.js | 22 +--------------------- admin/templates/default/acl.xet | 2 +- 2 files changed, 2 insertions(+), 22 deletions(-) diff --git a/admin/js/app.js b/admin/js/app.js index 5de17f13fc..d581c68979 100644 --- a/admin/js/app.js +++ b/admin/js/app.js @@ -472,27 +472,7 @@ app.classes.admin = AppJS.extend( } } - // Make sure selected values are there, account might not be in a default group - // so not in cache - if(content.acl_account && egw.user('apps')['admin']) - { - var accounts = this.egw.accounts('both'); - var there = false; - for(var i = 0; i < accounts.length; i++) - { - if(accounts[i].value == content.acl_account) - { - there = true; - break; - } - } - if(!there) - { - sel_options.acl_account = new Array().concat(sel_options.acl_account); - this.egw.link_title('home-accounts', content.acl_account, function(title) {sel_options.acl_account.push({value: content.acl_account, label: title});}); - } - } - else if (content.acl_account) + if(content.acl_account && !egw.user('apps')['admin']) { readonlys.acl_account = true; } diff --git a/admin/templates/default/acl.xet b/admin/templates/default/acl.xet index 9ad21516e9..96d9698b9b 100644 --- a/admin/templates/default/acl.xet +++ b/admin/templates/default/acl.xet @@ -2,7 +2,7 @@