From c5ddcdfcf9ae6c744f09c1a1d1ed265ece0208f0 Mon Sep 17 00:00:00 2001 From: Hadi Nategh Date: Tue, 31 Mar 2015 13:39:55 +0000 Subject: [PATCH] Fix regular expression in expose view - Exclude tif and xcf images from expose view - Define a global regexp for expose --- etemplate/js/et2_widget_description.js | 2 +- etemplate/js/expose.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/etemplate/js/et2_widget_description.js b/etemplate/js/et2_widget_description.js index ba2db0d235..ba832a5164 100644 --- a/etemplate/js/et2_widget_description.js +++ b/etemplate/js/et2_widget_description.js @@ -239,7 +239,7 @@ var et2_description = expose(et2_baseWidget.extend([et2_IDetachedDOM], var self= this; var $span = this.options.mime_data? jQuery(this.span): jQuery('a',this.span); $span.click(function(e) { - if (self.options.expose_view && typeof self.options.mime !='undefined' && self.options.mime.match(/video\/|image\/|audio\//,'ig')) + if (self.options.expose_view && typeof self.options.mime !='undefined' && self.options.mime.match(self.mime_regexp,'ig')) { self._init_blueimp_gallery(e, href); } diff --git a/etemplate/js/expose.js b/etemplate/js/expose.js index 2b9478705c..1896997003 100644 --- a/etemplate/js/expose.js +++ b/etemplate/js/expose.js @@ -48,7 +48,7 @@ function expose (widget) }; // For filtering to only show things we can handle - var mime_regex = new RegExp(/video\/|image\/|audio\//); + var mime_regex = new RegExp(/(video\/)|(image\/:*(?!tif|x-xcf))|(audio\/)/); // Only one gallery var gallery = null; @@ -206,7 +206,7 @@ function expose (widget) init: function() { this._super.apply(this, arguments); - + this.mime_regexp = mime_regex; var self=this; this.expose_options = { // The Id, element or querySelector of the gallery widget: