Photo Gallery by Supsystic - Version 1.13.7

Version Description

Download this release

Release Info

Developer supsystic.com
Plugin Icon 128x128 Photo Gallery by Supsystic
Version 1.13.7
Comparing to
See all releases

Code changes from version 1.13.2 to 1.13.7

index.php CHANGED
@@ -3,7 +3,7 @@
3
  /**
4
  * Plugin Name: Photo Gallery by Supsystic
5
  * Description: Easy to use Gallery by Supsystic with professional gallery templates. Show off your best design, photography and creative work
6
- * Version: 1.13.2
7
  * Author: supsystic.com
8
  * Author URI: https://supsystic.com
9
  * Text Domain: grid-gallery
@@ -11,5 +11,5 @@
11
 
12
  require_once dirname(__FILE__) . '/app/SupsysticGallery.php';
13
 
14
- $supsysticGallery = new SupsysticGallery('1.13.2');
15
  $supsysticGallery->run();
3
  /**
4
  * Plugin Name: Photo Gallery by Supsystic
5
  * Description: Easy to use Gallery by Supsystic with professional gallery templates. Show off your best design, photography and creative work
6
+ * Version: 1.13.7
7
  * Author: supsystic.com
8
  * Author URI: https://supsystic.com
9
  * Text Domain: grid-gallery
11
 
12
  require_once dirname(__FILE__) . '/app/SupsysticGallery.php';
13
 
14
+ $supsysticGallery = new SupsysticGallery('1.13.7');
15
  $supsysticGallery->run();
readme.txt CHANGED
@@ -2,8 +2,8 @@
2
  Contributors: supsystic.com
3
  Donate link: https://supsystic.com/plugins/gallery
4
  Tags: gallery, wordpress gallery plugin, photo gallery, grid gallery, image gallery, video gallery, responsive gallery, polaroid gallery
5
- Tested up to: 5.1.1
6
- Stable tag: 1.13.2
7
 
8
  Photo Gallery with template editor to build amazing media gallery. Responsive mobile gallery with grid, masonry, carousel, polaroid and more gallery
9
 
@@ -171,6 +171,37 @@ Add watermark on each image in your gallery and you protect your photos from the
171
  14. Photo gallery plugin admin area. Captions and Icons tab. Create impressive gallery with icons and fantastic caption effect.
172
  == Changelog ==
173
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
174
  = Gallery 1.13.2 / 27.03.2019 =
175
  * Added option Flexible Height for categories
176
  * Updated IT translation
2
  Contributors: supsystic.com
3
  Donate link: https://supsystic.com/plugins/gallery
4
  Tags: gallery, wordpress gallery plugin, photo gallery, grid gallery, image gallery, video gallery, responsive gallery, polaroid gallery
5
+ Tested up to: 5.2
6
+ Stable tag: 1.13.7
7
 
8
  Photo Gallery with template editor to build amazing media gallery. Responsive mobile gallery with grid, masonry, carousel, polaroid and more gallery
9
 
171
  14. Photo gallery plugin admin area. Captions and Icons tab. Create impressive gallery with icons and fantastic caption effect.
172
  == Changelog ==
173
 
174
+ = Gallery 1.13.7 / 26.06.2019 =
175
+ * Add Enable Download Photos Button
176
+ * Add Update watermark option
177
+ * Minor issues fixes
178
+
179
+ = Gallery 1.13.6 / 29.05.2019 =
180
+ * Fix conflict with other colorbox scripts
181
+ * Fixes for Polaroid Style
182
+ * Fix Close Button in Fullscreen popup
183
+ * Added percent height for caption elements
184
+ * Added default settings for Polaroid Style
185
+ * Minor issues fixes
186
+
187
+ = Gallery 1.13.5 / 13.05.2019 =
188
+ * Fix for personal hover and lazyload
189
+ * Fix caption margin
190
+ * Added save only links for Google drive
191
+ * Added mimeType=image/gif for Google drive import
192
+ * Fix for Horizontal scroll on mobile devices
193
+ * Minor issues fixes
194
+
195
+ = Gallery 1.13.4 / 23.04.2019 =
196
+ * Fix: Fix load more bug
197
+ * Fix: Fix for horizontal scroll
198
+ * Fix: Fixed polaroid style
199
+ * Minor issues fixes
200
+
201
+ = Gallery 1.13.3 / 01.04.2019 =
202
+ * Google fonts fix for old Pro versions
203
+ * Minor issues fixes
204
+
205
  = Gallery 1.13.2 / 27.03.2019 =
206
  * Added option Flexible Height for categories
207
  * Updated IT translation
src/GridGallery/Colorbox/jquery-colorbox/jquery.colorbox.js CHANGED
@@ -90,7 +90,8 @@
90
  },
91
  title: function () {
92
  return this.title;
93
- }
 
94
  },
95
 
96
 
@@ -554,7 +555,8 @@
554
 
555
  // Don't do anything if Colorbox already exists.
556
  if ($.colorbox) {
557
- return;
 
558
  }
559
 
560
  // Append the HTML when the DOM loads
90
  },
91
  title: function () {
92
  return this.title;
93
+ },
94
+ supsysticGallery: true
95
  },
96
 
97
 
555
 
556
  // Don't do anything if Colorbox already exists.
557
  if ($.colorbox) {
558
+ if(typeof $.colorbox.settings.supsysticGallery != 'undefined') return;
559
+ $.colorbox = null;
560
  }
561
 
562
  // Append the HTML when the DOM loads
src/GridGallery/Core/BaseController.php CHANGED
@@ -25,7 +25,7 @@ class GridGallery_Core_BaseController extends Rsc_Mvc_Controller
25
  public function response($template, array $data = array())
26
  {
27
  if ($template === 'ajax') {
28
- ob_clean();
29
 
30
  $baseModel = new GridGallery_Core_BaseModel();
31
  $error = $baseModel->getLastError();
25
  public function response($template, array $data = array())
26
  {
27
  if ($template === 'ajax') {
28
+ //ob_clean();
29
 
30
  $baseModel = new GridGallery_Core_BaseModel();
31
  $error = $baseModel->getLastError();
src/GridGallery/Galleries/Attachment.php CHANGED
@@ -159,7 +159,11 @@ class GridGallery_Galleries_Attachment
159
  */
160
  public function getMetadata($attachmentId)
161
  {
162
- return wp_prepare_attachment_for_js($attachmentId);
 
 
 
 
163
  }
164
 
165
  /**
159
  */
160
  public function getMetadata($attachmentId)
161
  {
162
+ $data = wp_prepare_attachment_for_js($attachmentId);
163
+ if(substr($data['url'], 0, 1) == '/') {
164
+ $data['url'] = get_site_url().$data['url'];
165
+ }
166
+ return $data;
167
  }
168
 
169
  /**
src/GridGallery/Galleries/Model/Galleries.php CHANGED
@@ -74,7 +74,7 @@ class GridGallery_Galleries_Model_Galleries extends GridGallery_Core_BaseModel
74
  {
75
 
76
  $query = array(
77
- 'SELECT {prefix}gg_galleries.*, {prefix}gg_photos.attachment_id, r.total, {prefix}gg_settings_sets.data as settings',
78
  'FROM {prefix}gg_galleries',
79
  'LEFT JOIN',
80
  '(SELECT count(resource_id) as total, resource_id, gallery_id',
74
  {
75
 
76
  $query = array(
77
+ 'SELECT {prefix}gg_galleries.*, {prefix}gg_photos.attachment_id, r.total, {prefix}gg_settings_sets.data as settings, {prefix}gg_photos.link_default',
78
  'FROM {prefix}gg_galleries',
79
  'LEFT JOIN',
80
  '(SELECT count(resource_id) as total, resource_id, gallery_id',
src/GridGallery/Galleries/Model/widget.php CHANGED
@@ -66,7 +66,7 @@ class sggWidget extends Wp_Widget {
66
  <label for="<?php echo $this->get_field_id( 'gallery_id' ); ?>"><?php _e( 'Select gallery: ' ); ?></label>
67
  <select id="<?php echo $this->get_field_id( 'gallery_id' ); ?>" class="widefat" name="<?php echo $this->get_field_name( 'gallery_id' ); ?>" type="text">
68
  <?php foreach($id as $element)
69
- if($instance['gallery_id'] == $element['value']) {
70
  echo "<option value=" . $element['value'] . " selected>". $element['name'] . "</option>";
71
  } else {
72
  echo "<option value=" . $element['value'] . ">". $element['name'] . "</option>";
66
  <label for="<?php echo $this->get_field_id( 'gallery_id' ); ?>"><?php _e( 'Select gallery: ' ); ?></label>
67
  <select id="<?php echo $this->get_field_id( 'gallery_id' ); ?>" class="widefat" name="<?php echo $this->get_field_name( 'gallery_id' ); ?>" type="text">
68
  <?php foreach($id as $element)
69
+ if(isset($instance['gallery_id']) && $instance['gallery_id'] == $element['value']) {
70
  echo "<option value=" . $element['value'] . " selected>". $element['name'] . "</option>";
71
  } else {
72
  echo "<option value=" . $element['value'] . ">". $element['name'] . "</option>";
src/GridGallery/Galleries/Module.php CHANGED
@@ -254,6 +254,7 @@ class GridGallery_Galleries_Module extends GridGallery_Core_Module
254
  wp_enqueue_script($handle);
255
  }
256
  wp_localize_script('sgg-frontend-js', 'sggStandartFontsList', $this->getModule('ui')->getStandardFontsList());
 
257
 
258
  //on shutdown check is footer is printed , if not print scripts for our gallery
259
  //add_action('shutdown', array($this,'shutdown'));
@@ -461,8 +462,10 @@ class GridGallery_Galleries_Module extends GridGallery_Core_Module
461
  }
462
 
463
  foreach($gallery->photos as $photo) {
464
- $photo->attachment['caption'] = html_entity_decode($photo->attachment['caption']);
465
- $photo->attachment['description'] = html_entity_decode($photo->attachment['description']);
 
 
466
  }
467
  }
468
 
254
  wp_enqueue_script($handle);
255
  }
256
  wp_localize_script('sgg-frontend-js', 'sggStandartFontsList', $this->getModule('ui')->getStandardFontsList());
257
+ wp_localize_script('sgg-frontend-js', 'sggIsMobile', array($this->getModel('settings')->isMobile(true) ? 1 : 0));
258
 
259
  //on shutdown check is footer is printed , if not print scripts for our gallery
260
  //add_action('shutdown', array($this,'shutdown'));
462
  }
463
 
464
  foreach($gallery->photos as $photo) {
465
+ if(!is_null($photo->attachment)) {
466
+ $photo->attachment['caption'] = html_entity_decode($photo->attachment['caption']);
467
+ $photo->attachment['description'] = html_entity_decode($photo->attachment['description']);
468
+ }
469
  }
470
  }
471
 
src/GridGallery/Galleries/assets/css/grid-gallery.galleries.effects.css CHANGED
@@ -62,6 +62,7 @@ a.post .grid-gallery-caption {
62
  font-size: 0.8em;
63
  padding: 10px;
64
  line-height: normal;
 
65
  }
66
 
67
  .grid-gallery-caption[data-grid-gallery-type="none"] figcaption {
@@ -2015,10 +2016,13 @@ a.post .grid-gallery-caption {
2015
  .gg-caption-row:nth-child(3) {
2016
  height: 34%;
2017
  }
2018
- .gg-caption-row.top, .gg-caption-row.middle, .gg-caption-row.bottom {
2019
  position: absolute;
2020
  width: 100%;
2021
  }
 
 
 
2022
  .gg-caption-row.top {
2023
  top: 0;
2024
  }
62
  font-size: 0.8em;
63
  padding: 10px;
64
  line-height: normal;
65
+ margin-top: 0;
66
  }
67
 
68
  .grid-gallery-caption[data-grid-gallery-type="none"] figcaption {
2016
  .gg-caption-row:nth-child(3) {
2017
  height: 34%;
2018
  }
2019
+ .gg-caption-row.top, .gg-caption-row.middle, .gg-caption-row.bottom, .gg-caption-row.center {
2020
  position: absolute;
2021
  width: 100%;
2022
  }
2023
+ .grid-gallery-caption[data-grid-gallery-type="polaroid"] .gg-caption-row {
2024
+ left: 0;
2025
+ }
2026
  .gg-caption-row.top {
2027
  top: 0;
2028
  }
src/GridGallery/Galleries/assets/css/photobox.css CHANGED
@@ -59,6 +59,7 @@
59
 
60
  -webkit-backface-visibility:hidden;
61
  box-shadow:0 0 20px #000;
 
62
  }
63
 
64
  /* FOR MOBILE */
@@ -78,7 +79,7 @@
78
  .hide #pbCloseBtn{ top:-50px; right:-50px; }
79
  .on #pbCloseBtn{ top:-2px; right:-2px; }
80
 
81
- #pbCloseBtn:before{ content:'\00D7'; font:bold 1em/1 arial; }
82
  #pbCloseBtn:before, #pbAutoplayBtn:before{ display:inline-block; height:35px; width:35px; padding:8px 8px 12px 12px; font-size:2em; opacity:0.8; vertical-align:middle; background:rgba(255,255,255,0.2); border-radius:0 0 0 70px; transition:0.1s ease-out; }
83
  #pbCloseBtn:hover:before{ padding:15px 10px 24px 24px; background:rgba(255,100,100,.4); }
84
 
59
 
60
  -webkit-backface-visibility:hidden;
61
  box-shadow:0 0 20px #000;
62
+ margin: auto;
63
  }
64
 
65
  /* FOR MOBILE */
79
  .hide #pbCloseBtn{ top:-50px; right:-50px; }
80
  .on #pbCloseBtn{ top:-2px; right:-2px; }
81
 
82
+ #pbCloseBtn:before{ content:'\00D7'; font:bold 1em/1 arial; box-sizing: initial; font-size: 32px !important; line-height: 32px;}
83
  #pbCloseBtn:before, #pbAutoplayBtn:before{ display:inline-block; height:35px; width:35px; padding:8px 8px 12px 12px; font-size:2em; opacity:0.8; vertical-align:middle; background:rgba(255,255,255,0.2); border-radius:0 0 0 70px; transition:0.1s ease-out; }
84
  #pbCloseBtn:hover:before{ padding:15px 10px 24px 24px; background:rgba(255,100,100,.4); }
85
 
src/GridGallery/Galleries/assets/js/frontend.js CHANGED
@@ -22,6 +22,9 @@
22
  this.loadedFonts = [];
23
 
24
  this.$container = $(selector);
 
 
 
25
  this.$container.addClass('fitvidsignore');
26
  this.$elements = this.$container.find('figure.grid-gallery-caption').fadeIn();
27
  this.initialMargin = this.$elements.first().css('margin-bottom');
@@ -154,7 +157,8 @@
154
  offset = 0,
155
  outerOffset = 0,
156
  spacing,
157
- windowWidth = $(window).width();
 
158
  // if responsive mode = 'one by one' and mobile -> run this method
159
  if (horizontalScroll && horizontalScroll.enabled) {
160
  if(horizontalScroll.responsiveMode == 1 && isMobile) {} else {
@@ -187,6 +191,11 @@
187
  });
188
  }
189
 
 
 
 
 
 
190
 
191
  function resizeColumns() {
192
  var columnsNumber = self.getResponsiveColumnsNumber();
@@ -198,17 +207,30 @@
198
 
199
  var $el = $(el),
200
  $img = $el.find('img');
201
- if($img.length) {
202
  var imageOriginalSize = self.getOriginalImageSizes($img.get(0)),
203
  elWidth = imageOriginalSize.width,
204
  elHeight = imageOriginalSize.height,
205
  aspectRatio = elWidth / elHeight,
206
  height = width / aspectRatio;
207
 
 
 
 
 
208
  $el.css({
209
  width: width,
210
  height: height,
211
  });
 
 
 
 
 
 
 
 
 
212
  }
213
  });
214
  self.$container.find('.grid-gallery-photos').removeAttr('data-min-height');
@@ -218,7 +240,7 @@
218
 
219
  if (this.$container.data('columns-number')) {
220
 
221
- self.$container.find('img').css({
222
  maxWidth: '100%',
223
  width: '100%',
224
  height: 'auto'
@@ -1199,7 +1221,7 @@
1199
  $style = $('<style/>', { id: styleId });
1200
  $('head').append($style);
1201
  }
1202
- familyName = familyName.replace(/\s+/g, '+');
1203
 
1204
  var obj = document.getElementById(styleId),
1205
  sheet = obj.sheet || obj.styleSheet;
@@ -1255,33 +1277,33 @@
1255
  return Math.round(( ( ( Math.atan2(y, x) * (180 / Math.PI) ) + 180 ) / 90 ) + 3) % 4;
1256
  };
1257
 
1258
- Gallery.prototype.initCaptionEffects = (function () {
1259
- var self = this,
1260
- allwaysShowCaptionOnMobile = this.$container.data('caption-mobile'),
1261
- disableCaptionOnMobile = this.$container.data('caption-disabled-on-mobile'),
1262
- isMobile = !!parseInt(this.$container.data('is-mobile'));
1263
-
1264
- function generateOverlayColor(overlayColor, alpha) {
1265
- if(typeof(overlayColor) == 'string'){
1266
- overlayColor = overlayColor.split(')');
1267
 
1268
- if(overlayColor.length > 0) {
1269
- overlayColor = overlayColor[0].split('(');
1270
 
1271
- if(overlayColor.length > 1) {
1272
- var chanels = overlayColor[1].split(',');
1273
 
1274
- if(chanels.length == 4) { // it is already rgba (fix for IE)
1275
- overlayColor[0] = overlayColor[0].replace('a', '');
1276
- chanels.splice(-1,1);
1277
- overlayColor[1] = chanels.join(',');
1278
- }
1279
- return overlayColor[0] + 'a(' + overlayColor[1] + ', ' + (1 - alpha/10) + ')';
1280
- }
1281
- }
1282
  }
1283
- return overlayColor;
1284
  }
 
 
 
 
 
 
 
 
1285
 
1286
  if(isMobile && navigator && navigator.userAgent && navigator.userAgent.indexOf("Safari") > -1) {
1287
  var $3dCubeCaptions = this.$container.find('.grid-gallery-caption[data-grid-gallery-type="3d-cube"]');
@@ -1323,62 +1345,6 @@
1323
  });
1324
  }
1325
 
1326
- if ($el.data('grid-gallery-type') == 'polaroid') {
1327
- if (!$(this).find('.post-feed-crop').length && !$el.hasClass('initialized')) {
1328
- $el.addClass('initialized');
1329
-
1330
- var width = $el.width(),
1331
- frameWidth = parseInt(self.$container.data('polaroid-frame-width'), 10) || 20,
1332
- $img = $(this).find('img'),
1333
- $figcaption = $(this).find('figcaption'),
1334
- scaleRatio = $img.width() / $img.height(),
1335
- imageWidth = $img.width() - frameWidth * 2,
1336
- imageHeight = imageWidth / scaleRatio;
1337
-
1338
- $img.css({
1339
- 'width': imageWidth + 'px',
1340
- 'height': imageHeight + 'px',
1341
- 'margin': frameWidth + 'px auto 0',
1342
- });
1343
-
1344
- $(this).find('.crop').css({
1345
- 'height': imageHeight + frameWidth + 'px',
1346
- });
1347
-
1348
- $(this).css({
1349
- 'background': overlayColor
1350
- })
1351
-
1352
- $(this).css({
1353
- 'width': $(this).width(),
1354
- 'background': generateOverlayColor(overlayColor, alpha)
1355
- });
1356
-
1357
- $figcaption.css({
1358
- 'padding': frameWidth + 'px',
1359
- 'background': 'none'
1360
- });
1361
-
1362
- if ($figcaption.find('.grid-gallery-figcaption-wrap').text().length === 0) {
1363
- $figcaption
1364
- .find('.grid-gallery-figcaption-wrap')
1365
- .append('<span></span>');
1366
- }
1367
-
1368
-
1369
- if (self.$container.data('polaroid-animation')) {
1370
- $el.addClass('polaroid-animation');
1371
- }
1372
-
1373
- if (self.$container.data('polaroid-scattering')) {
1374
- $(this).css({
1375
- 'transform': 'rotate(' + (-3 + Math.random() * (10 - 3)) + 'deg)'
1376
- });
1377
- $el.addClass('polaroid-scattering');
1378
- }
1379
- }
1380
- }
1381
-
1382
  if ($el.data('grid-gallery-type') == 'direction-aware') {
1383
  var color = $el.find('figcaption').css('color'),
1384
  isCaptionBuilderUsed = self.$container.data('caption-buider'),
@@ -1403,7 +1369,7 @@
1403
 
1404
  $el.sliphover({
1405
  target: $el,
1406
- backgroundColor: generateOverlayColor(overlayColor, alpha),
1407
  fontColor: color,
1408
  textAlign: align,
1409
  caption: 'data-caption'
@@ -1423,6 +1389,16 @@
1423
  self.changeImageHeightFor3dCubeEffect($el, cubeWidth, cubeHeight);
1424
  }
1425
  }
 
 
 
 
 
 
 
 
 
 
1426
  });
1427
 
1428
  $(document).on('click', '.sliphover-container', function(event) {
@@ -1473,6 +1449,105 @@
1473
 
1474
  });
1475
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1476
  Gallery.prototype.changeImageHeightFor3dCubeEffect = (function($figure, cubeWidth, cubeHeight) {
1477
  // check params
1478
  if(!$figure) {
@@ -1603,12 +1678,12 @@
1603
  this.$container.css({
1604
  width: windowWidth,
1605
  left: '-' + containerOffsetLeft + 'px',
1606
- 'max-width': '100%'
1607
  });
1608
  this.$container.find('.grid-gallery-nav').css('width', windowWidth + 'px');
1609
  } else {
1610
  this.$container.css({
1611
- width: windowWidth , 'max-width': '100%'
1612
  }).offset(function(i, coords) {
1613
  return {'top' : coords.top, 'left' : 0};
1614
  });
@@ -1692,7 +1767,8 @@
1692
  $image = $figure.find('img');
1693
  sizes = self.getOriginalImageSizes($image.get(0));
1694
  $image.css('max-width', 'none');
1695
- $figure.width(Math.floor((height / sizes.height) * sizes.width));
 
1696
  });
1697
  }
1698
 
@@ -1764,7 +1840,10 @@
1764
  'min-height': height,
1765
  });
1766
  }
1767
- this.resizeHorizontalElements();
 
 
 
1768
  });
1769
 
1770
  Gallery.prototype.hidePreloader = function() {
@@ -2373,11 +2452,23 @@
2373
  clearTimeout(self.ggLazyTimeOut);
2374
  }
2375
  self.ggLazyTimeOut = setTimeout(function() {
 
 
 
 
 
 
 
 
 
2376
  switch(galleryType) {
2377
  case 4:
2378
  $(document).trigger('ggMosaicResizedEvent');
2379
  break;
2380
  case 0:
 
 
 
2381
  // if hidden images not showing
2382
  setTimeout(function() {
2383
  self.lazyLoadTriggerHandler();
@@ -2386,7 +2477,7 @@
2386
  self.wookmark.trigger('refreshWookmark');
2387
  }
2388
  }, 50);
2389
- }, waitTime + 10);//450); // animation transition time
2390
  break;
2391
  case 1:
2392
  if(typeof(self.setCaptionOnHoverImage) == 'function') {
@@ -2401,15 +2492,15 @@
2401
  case 2:
2402
  case 3:
2403
  default:
2404
- self.initWookmark();
2405
  // if hidden images not showing
2406
  setTimeout(function() {
2407
  self.lazyLoadTriggerHandler();
2408
  self.initWookmark();
2409
- }, waitTime + 10);//450); // animation transition time
2410
  break;
2411
  }
2412
- }, 200);
2413
  });
2414
 
2415
  Gallery.prototype.initLazyLoad = (function() {
@@ -2439,7 +2530,9 @@
2439
  'load': function(event) {
2440
  var image = $(this);
2441
  self.lazyLoadDistanceRefresh(waitTime);
2442
- image.closest('div .crop').css('height', '');
 
 
2443
  image.closest('figure').css('height', 'auto');
2444
  if(self.$container.data('gridType') == 2 && self.$elements) {
2445
  setTimeout(function() {
@@ -2613,6 +2706,7 @@
2613
  $(window).on('resize', $.proxy(function () {
2614
  this.correctMargin();
2615
  this.resizeHorizontalElements();
 
2616
  }, this));
2617
  });
2618
 
@@ -2631,9 +2725,13 @@
2631
 
2632
  Gallery.prototype.resizeElementHeight = (function (image, element) {
2633
  var imageHeight = parseInt(image.css('height'));
2634
- if(!isNaN(imageHeight)) {
2635
  element.css('height', Math.floor(imageHeight - 1) + 'px');
2636
  }
 
 
 
 
2637
  });
2638
 
2639
  window.initGridGallery = (function (el, autoInit) {
22
  this.loadedFonts = [];
23
 
24
  this.$container = $(selector);
25
+ if(window.sggIsMobile) {
26
+ this.$container.attr('data-is-mobile', window.sggIsMobile[0]);
27
+ }
28
  this.$container.addClass('fitvidsignore');
29
  this.$elements = this.$container.find('figure.grid-gallery-caption').fadeIn();
30
  this.initialMargin = this.$elements.first().css('margin-bottom');
157
  offset = 0,
158
  outerOffset = 0,
159
  spacing,
160
+ windowWidth = $(window).width(),
161
+ isFixedColumn = this.$container.data('gridType') == 3;
162
  // if responsive mode = 'one by one' and mobile -> run this method
163
  if (horizontalScroll && horizontalScroll.enabled) {
164
  if(horizontalScroll.responsiveMode == 1 && isMobile) {} else {
191
  });
192
  }
193
 
194
+ if(isFixedColumn) {
195
+ var defaultWidth = parseInt(width),
196
+ defaultHeight = parseInt(this.$container.data('height')),
197
+ koefWidthHeigth = defaultWidth > 0 && defaultHeight > 0 ? defaultHeight/defaultWidth : 1;
198
+ }
199
 
200
  function resizeColumns() {
201
  var columnsNumber = self.getResponsiveColumnsNumber();
207
 
208
  var $el = $(el),
209
  $img = $el.find('img');
210
+ if($img.length && !$el.hasClass('initialized')) {
211
  var imageOriginalSize = self.getOriginalImageSizes($img.get(0)),
212
  elWidth = imageOriginalSize.width,
213
  elHeight = imageOriginalSize.height,
214
  aspectRatio = elWidth / elHeight,
215
  height = width / aspectRatio;
216
 
217
+ if(isFixedColumn && $img.attr('data-gg-remote-image') == 1) {
218
+ height = width * koefWidthHeigth;
219
+ }
220
+
221
  $el.css({
222
  width: width,
223
  height: height,
224
  });
225
+ if(!$img.hasClass('ggLazyImg')) {
226
+ $img.removeClass('ggNotInitImg');
227
+ self.polaroidCaptionCalculate($el);
228
+ if($el.hasClass('initialized')) {
229
+ setTimeout(function() {
230
+ $el.trigger('refreshWookmark');
231
+ }, 350);
232
+ }
233
+ }
234
  }
235
  });
236
  self.$container.find('.grid-gallery-photos').removeAttr('data-min-height');
240
 
241
  if (this.$container.data('columns-number')) {
242
 
243
+ self.$container.find('figure:not(.initialized) img').css({
244
  maxWidth: '100%',
245
  width: '100%',
246
  height: 'auto'
1221
  $style = $('<style/>', { id: styleId });
1222
  $('head').append($style);
1223
  }
1224
+ familyName = familyName.replace(/\s+/g, '+').replace(/"/g, '');
1225
 
1226
  var obj = document.getElementById(styleId),
1227
  sheet = obj.sheet || obj.styleSheet;
1277
  return Math.round(( ( ( Math.atan2(y, x) * (180 / Math.PI) ) + 180 ) / 90 ) + 3) % 4;
1278
  };
1279
 
1280
+ Gallery.prototype.generateOverlayCaptionColor = (function (overlayColor, alpha) {
1281
+ if(typeof(overlayColor) == 'string'){
1282
+ overlayColor = overlayColor.split(')');
 
 
 
 
 
 
1283
 
1284
+ if(overlayColor.length > 0) {
1285
+ overlayColor = overlayColor[0].split('(');
1286
 
1287
+ if(overlayColor.length > 1) {
1288
+ var chanels = overlayColor[1].split(',');
1289
 
1290
+ if(chanels.length == 4) { // it is already rgba (fix for IE)
1291
+ overlayColor[0] = overlayColor[0].replace('a', '');
1292
+ chanels.splice(-1,1);
1293
+ overlayColor[1] = chanels.join(',');
1294
+ }
1295
+ return overlayColor[0] + 'a(' + overlayColor[1] + ', ' + (1 - alpha/10) + ')';
1296
+ }
 
1297
  }
 
1298
  }
1299
+ return overlayColor;
1300
+ });
1301
+
1302
+ Gallery.prototype.initCaptionEffects = (function () {
1303
+ var self = this,
1304
+ allwaysShowCaptionOnMobile = this.$container.data('caption-mobile'),
1305
+ disableCaptionOnMobile = this.$container.data('caption-disabled-on-mobile'),
1306
+ isMobile = !!parseInt(this.$container.data('is-mobile'));
1307
 
1308
  if(isMobile && navigator && navigator.userAgent && navigator.userAgent.indexOf("Safari") > -1) {
1309
  var $3dCubeCaptions = this.$container.find('.grid-gallery-caption[data-grid-gallery-type="3d-cube"]');
1345
  });
1346
  }
1347
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1348
  if ($el.data('grid-gallery-type') == 'direction-aware') {
1349
  var color = $el.find('figcaption').css('color'),
1350
  isCaptionBuilderUsed = self.$container.data('caption-buider'),
1369
 
1370
  $el.sliphover({
1371
  target: $el,
1372
+ backgroundColor: self.generateOverlayCaptionColor(overlayColor, alpha),
1373
  fontColor: color,
1374
  textAlign: align,
1375
  caption: 'data-caption'
1389
  self.changeImageHeightFor3dCubeEffect($el, cubeWidth, cubeHeight);
1390
  }
1391
  }
1392
+
1393
+ if ($el.data('grid-gallery-type') == 'polaroid') {
1394
+ self.polaroidCaptionCalculate($el);
1395
+ } else {
1396
+ var topRow = $el.find('.gg-caption-row.top'),
1397
+ centerRow = $el.find('.gg-caption-row.center');
1398
+ if(centerRow.length == 1 && topRow.length == 1) {
1399
+ centerRow.css({'top': topRow.height(), 'transform': 'initial'});
1400
+ }
1401
+ }
1402
  });
1403
 
1404
  $(document).on('click', '.sliphover-container', function(event) {
1449
 
1450
  });
1451
 
1452
+ Gallery.prototype.polaroidCaptionCalculate = (function ($el) {
1453
+ if ($el.data('grid-gallery-type') != 'polaroid' || $(this).find('.post-feed-crop').length || $el.hasClass('initialized')) return;
1454
+ var $img = $el.find('img');
1455
+
1456
+ if($img.hasClass('ggLazyImg') || $img.hasClass('ggNotInitImg')) return;
1457
+ if($el.closest('.gg-mw-row').hasClass('sggDisplNone')) return;
1458
+
1459
+ $el.addClass('initialized');
1460
+ $img.finish();
1461
+ var width = $el.width(),
1462
+ gridType = this.$container.data('gridType'),
1463
+ frameWidth = parseInt(this.$container.data('polaroid-frame-width'), 10) || 20,
1464
+ captionHeight = this.$container.data('polaroid-caption-height'),
1465
+ clearHeight = captionHeight ? parseInt(captionHeight.toString().match(/\d.?\d*.?\d*/)[0]) : 0,
1466
+ overlayColor = $el.find('figcaption').css('backgroundColor'),
1467
+ alpha = parseInt($el.find('figcaption').data('alpha')),
1468
+ $figcaption = $el.find('figcaption'),
1469
+ scaleRatio = $img.width() / $img.height();
1470
+ if(gridType == 2) {
1471
+ var imageHeight = $img.height() - frameWidth * 2,
1472
+ imageWidth = imageHeight * scaleRatio;
1473
+ } else {
1474
+ var imageWidth = $img.width() - frameWidth * 2,
1475
+ imageHeight = imageWidth / scaleRatio;
1476
+ }
1477
+ var figcaptionHeight = !isNaN(clearHeight) && clearHeight != 0 ? (captionHeight.toString().indexOf('%') > 0 ? (imageHeight * clearHeight / 100) : clearHeight) : 0,
1478
+ figureFullHeight = imageHeight + frameWidth * 2 + figcaptionHeight;
1479
+
1480
+ $img.css({
1481
+ 'width': imageWidth + 'px',
1482
+ 'height': imageHeight + 'px',
1483
+ 'margin': frameWidth + 'px auto 0',
1484
+ });
1485
+ $el.find('.gg-caption-table').css('height', '1px');
1486
+
1487
+ $el.find('.crop').css({
1488
+ 'height': imageHeight + frameWidth + 'px'
1489
+ });
1490
+ if(gridType == 0) {
1491
+ $el.find('.crop').css('overflow', 'visible');
1492
+ } else if(gridType == 2) {
1493
+ $el.css({
1494
+ 'height': figureFullHeight + 'px',
1495
+ 'width': imageWidth + frameWidth * 2 + 'px',
1496
+ });
1497
+ } else if(gridType == 3) {
1498
+ $el.css({
1499
+ 'height': figureFullHeight + 'px',
1500
+ });
1501
+ }
1502
+
1503
+ $el.css({
1504
+ 'background': overlayColor
1505
+ });
1506
+ $el.css({
1507
+ 'width': $el.width(),
1508
+ 'background': this.generateOverlayCaptionColor(overlayColor, alpha)
1509
+ });
1510
+
1511
+ $figcaption.css({
1512
+ 'background': 'none',
1513
+ 'transition': 'none',
1514
+ });
1515
+ if(figcaptionHeight) {
1516
+ figcaptionHeight += 'px';
1517
+ $figcaption.css('height', figcaptionHeight);
1518
+ $el.find('.gg-caption-row').css({'max-height': figcaptionHeight ? figcaptionHeight : '100%', 'height': 'auto'});
1519
+ $el.find('.gg-caption-cell').css('height', '100%');
1520
+ if(gridType == 3) {
1521
+ $figcaption.css('margin-top', frameWidth + 'px');
1522
+ }
1523
+ } else {
1524
+ $figcaption.css('padding', frameWidth + 'px');
1525
+ }
1526
+
1527
+ if ($figcaption.find('.grid-gallery-figcaption-wrap').text().length === 0) {
1528
+ $figcaption
1529
+ .find('.grid-gallery-figcaption-wrap')
1530
+ .append('<span></span>');
1531
+ }
1532
+
1533
+ if (this.$container.data('polaroid-animation')) {
1534
+ $el.addClass('polaroid-animation');
1535
+ }
1536
+
1537
+ if (this.$container.data('polaroid-scattering')) {
1538
+ $el.css({
1539
+ 'transform': 'rotate(' + (-3 + Math.random() * (10 - 3)) + 'deg)'
1540
+ });
1541
+ $el.addClass('polaroid-scattering');
1542
+ }
1543
+ var slimScroll = $el.closest('div.slimScrollDiv');
1544
+ if(slimScroll.length) {
1545
+ var scrollHeight = figureFullHeight + 20 + 'px';
1546
+ slimScroll.css('height', scrollHeight);
1547
+ slimScroll.find('.grid-gallery-photos').css('height', scrollHeight);
1548
+ }
1549
+ });
1550
+
1551
  Gallery.prototype.changeImageHeightFor3dCubeEffect = (function($figure, cubeWidth, cubeHeight) {
1552
  // check params
1553
  if(!$figure) {
1678
  this.$container.css({
1679
  width: windowWidth,
1680
  left: '-' + containerOffsetLeft + 'px',
1681
+ //'max-width': '100%'
1682
  });
1683
  this.$container.find('.grid-gallery-nav').css('width', windowWidth + 'px');
1684
  } else {
1685
  this.$container.css({
1686
+ width: windowWidth //, 'max-width': '100%'
1687
  }).offset(function(i, coords) {
1688
  return {'top' : coords.top, 'left' : 0};
1689
  });
1767
  $image = $figure.find('img');
1768
  sizes = self.getOriginalImageSizes($image.get(0));
1769
  $image.css('max-width', 'none');
1770
+ if(!$image.hasClass('ggLazyImg'))
1771
+ $figure.width(Math.floor((height / sizes.height) * sizes.width));
1772
  });
1773
  }
1774
 
1840
  'min-height': height,
1841
  });
1842
  }
1843
+ var self = this;
1844
+ setTimeout(function() {
1845
+ self.resizeHorizontalElements();
1846
+ }, 50);
1847
  });
1848
 
1849
  Gallery.prototype.hidePreloader = function() {
2452
  clearTimeout(self.ggLazyTimeOut);
2453
  }
2454
  self.ggLazyTimeOut = setTimeout(function() {
2455
+ setTimeout(function() {
2456
+ $.each(self.$elements, function(index, el) {
2457
+ var $el = $(el);
2458
+ if ($el.data('grid-gallery-type') == 'polaroid'){
2459
+ self.polaroidCaptionCalculate($el);
2460
+ }
2461
+ });
2462
+ }, waitTime + 50);
2463
+
2464
  switch(galleryType) {
2465
  case 4:
2466
  $(document).trigger('ggMosaicResizedEvent');
2467
  break;
2468
  case 0:
2469
+ if(typeof(self.setCaptionOnHoverImage) == 'function') {
2470
+ self.setCaptionOnHoverImage();
2471
+ }
2472
  // if hidden images not showing
2473
  setTimeout(function() {
2474
  self.lazyLoadTriggerHandler();
2477
  self.wookmark.trigger('refreshWookmark');
2478
  }
2479
  }, 50);
2480
+ }, waitTime + 60);//450); // animation transition time
2481
  break;
2482
  case 1:
2483
  if(typeof(self.setCaptionOnHoverImage) == 'function') {
2492
  case 2:
2493
  case 3:
2494
  default:
2495
+ //self.initWookmark();
2496
  // if hidden images not showing
2497
  setTimeout(function() {
2498
  self.lazyLoadTriggerHandler();
2499
  self.initWookmark();
2500
+ }, waitTime + 50);//450); // animation transition time
2501
  break;
2502
  }
2503
+ }, 100);
2504
  });
2505
 
2506
  Gallery.prototype.initLazyLoad = (function() {
2530
  'load': function(event) {
2531
  var image = $(this);
2532
  self.lazyLoadDistanceRefresh(waitTime);
2533
+ if(self.$container.data('gridType') != 0) {
2534
+ image.closest('div .crop').css('height', '');
2535
+ }
2536
  image.closest('figure').css('height', 'auto');
2537
  if(self.$container.data('gridType') == 2 && self.$elements) {
2538
  setTimeout(function() {
2706
  $(window).on('resize', $.proxy(function () {
2707
  this.correctMargin();
2708
  this.resizeHorizontalElements();
2709
+ this.initHorizontalMode();
2710
  }, this));
2711
  });
2712
 
2725
 
2726
  Gallery.prototype.resizeElementHeight = (function (image, element) {
2727
  var imageHeight = parseInt(image.css('height'));
2728
+ if(!isNaN(imageHeight) && !element.hasClass('initialized')) {
2729
  element.css('height', Math.floor(imageHeight - 1) + 'px');
2730
  }
2731
+ if(!image.hasClass('ggLazyImg')) {
2732
+ image.removeClass('ggNotInitImg');
2733
+ this.polaroidCaptionCalculate(element);
2734
+ }
2735
  });
2736
 
2737
  window.initGridGallery = (function (el, autoInit) {
src/GridGallery/Galleries/assets/js/lib/jquery.prettyphoto.js CHANGED
@@ -1079,13 +1079,15 @@ Version: 3.1.6
1079
  currentGalleryPage = 0;
1080
  toInject = "";
1081
  for (var i=0; i < pp_images.length; i++) {
1082
- if(!pp_images[i].match(/\b(jpg|jpeg|png|gif)\b/gi)){
 
 
1083
  classname = 'default';
1084
  img_src = '';
1085
  }else{
1086
  classname = '';
1087
- img_src = pp_images[i];
1088
- thumbnail = $('[href="' +img_src + '"]').find('.crop > img');
1089
  if(thumbnail.length) {
1090
  if(pp_settings.is_lazy_load) {
1091
  img_src = thumbnail.attr('data-gg-real-image-href');
1079
  currentGalleryPage = 0;
1080
  toInject = "";
1081
  for (var i=0; i < pp_images.length; i++) {
1082
+ img_src = pp_images[i];
1083
+ thumbnail = $('[href="' +img_src + '"]').find('.crop > img');
1084
+ if(!(thumbnail.length && thumbnail.attr('data-gg-remote-image') == '1') && !pp_images[i].match(/\b(jpg|jpeg|png|gif)\b/gi)){
1085
  classname = 'default';
1086
  img_src = '';
1087
  }else{
1088
  classname = '';
1089
+ //img_src = pp_images[i];
1090
+ //thumbnail = $('[href="' +img_src + '"]').find('.crop > img');
1091
  if(thumbnail.length) {
1092
  if(pp_settings.is_lazy_load) {
1093
  img_src = thumbnail.attr('data-gg-real-image-href');
src/GridGallery/Galleries/assets/js/settings.js CHANGED
@@ -1469,7 +1469,51 @@ sggDataSelectorsCache.prototype.getFromArray = (function(key) {
1469
  });
1470
  };
1471
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1472
  Controller.prototype.polaroidEffectSettings = function () {
 
1473
  $('#polaroid-effect select').on('change', function(event) {
1474
  event.preventDefault();
1475
  var $overlayEffect = $('#overlayEffect').val()
@@ -1477,7 +1521,10 @@ sggDataSelectorsCache.prototype.getFromArray = (function(key) {
1477
  if ($(this).val() == 'true') {
1478
  $polaroidSettings.removeClass('hidden');
1479
  if ($overlayEffect !== 'polaroid') {
1480
- confirm('Caption Effect will change to Polaroid Style') && $('#effectsPreview [data-grid-gallery-type="polaroid"]').trigger('click');
 
 
 
1481
  }
1482
  } else {
1483
  $polaroidSettings.addClass('hidden');
@@ -2294,9 +2341,10 @@ sggDataSelectorsCache.prototype.getFromArray = (function(key) {
2294
  $(document).on('click', '#preview .hi-icon.fa', function(event) {
2295
  event.preventDefault();
2296
  });
2297
- $(document).one('input ifClicked', '.supsystic-plugin :input',function(event) {
2298
- controller.settingsChanged = true;
2299
- });
 
2300
 
2301
  } else if(qs.module === 'galleries' && qs.action === 'view') {
2302
  var viewController = new ggSettingsView();
@@ -2416,7 +2464,7 @@ sggDataSelectorsCache.prototype.getFromArray = (function(key) {
2416
  $style = $('<style/>', { id: styleId });
2417
  $('head').append($style);
2418
  }
2419
- familyName = familyName.replace(/\s+/g, '+');
2420
 
2421
  var obj = document.getElementById(styleId),
2422
  sheet = obj.sheet || obj.styleSheet;
@@ -3125,7 +3173,9 @@ sggDataSelectorsCache.prototype.getFromArray = (function(key) {
3125
  this.initOverlayShadow();
3126
  this.initSharedPropsForIcons();
3127
 
3128
- this.previewSettingsKeys = {};
 
 
3129
  this.objectsData = new sggDataSelectorsCache();
3130
  this.objectsData.init({
3131
  'keys': this.previewSettingsKeys,
@@ -3197,6 +3247,7 @@ sggDataSelectorsCache.prototype.getFromArray = (function(key) {
3197
 
3198
  ImagePreview.prototype.initCaptionEffects = (function () {
3199
  var self = this, figure = $('#preview figure.grid-gallery-caption');
 
3200
 
3201
  if(figure.attr('data-grid-gallery-type') == 'polaroid') {
3202
  if (!this.defaultStyles) {
@@ -3272,6 +3323,10 @@ sggDataSelectorsCache.prototype.getFromArray = (function(key) {
3272
  , $polaroidWrapper = $('.polaroid-bg-wrap')
3273
  , imageWidth
3274
  , imageHeight
 
 
 
 
3275
  ;
3276
 
3277
  if($galleryType.val() == 2) {
@@ -3287,26 +3342,34 @@ sggDataSelectorsCache.prototype.getFromArray = (function(key) {
3287
  imageWidth = parseInt($polaroidWrapper.outerWidth()) - (frameWidth*2);
3288
  imageHeight = imageWidth / scaleRatio;
3289
  }
 
 
 
 
 
 
 
3290
 
3291
  $img[0].style.setProperty('width', imageWidth + 'px', 'important');
3292
  $img[0].style.setProperty('height', imageHeight + 'px', 'important');
3293
  $img[0].style.setProperty('margin', '0 auto', 'important');
3294
  $img[0].style.setProperty('padding-top', frameWidth + 'px', 'important');
 
3295
 
3296
  $(this).css({
3297
  'width': $(this).width(),
3298
  });
3299
 
3300
- $figcaption.css('padding', frameWidth + 'px');
3301
 
3302
  var $backgroundColor = $('input[name="thumbnail[overlay][background]"]').val()
3303
  , $transparency = $('select[name="thumbnail[overlay][transparency]"]').val()
3304
- , css = hexToRgbA($backgroundColor, transparencyConvert[$transparency] );
3305
 
3306
  $(this).css({
3307
  'background-color': css
3308
  });
3309
- $(this).find('figcaption').css({'background': 'none'});
3310
 
3311
  if ($('#polaroid-scattering select').val() == 'true') {
3312
  $(this).css({
@@ -3322,6 +3385,9 @@ sggDataSelectorsCache.prototype.getFromArray = (function(key) {
3322
  } else {
3323
  $('#preview .grid-gallery-caption').removeClass('polaroid-animation');
3324
  }
 
 
 
3325
  }else{
3326
  var $backgroundColor = $('input[name="thumbnail[overlay][background]"]').val()
3327
  , $transparency = $('select[name="thumbnail[overlay][transparency]"]').val()
@@ -3329,6 +3395,12 @@ sggDataSelectorsCache.prototype.getFromArray = (function(key) {
3329
 
3330
  $(this).find('figcaption').css({'background-color': css});
3331
 
 
 
 
 
 
 
3332
  }
3333
  });
3334
  });
1469
  });
1470
  };
1471
 
1472
+ Controller.prototype.setPolaroidDefaultSettings = function () {
1473
+ $('input[name="thumbnail[overlay][background]"]').wpColorPicker('color', '#ededed');
1474
+ $('select[name="thumbnail[overlay][transparency]"]').val('1');
1475
+ $('input[name="captionBuilder[title][bgColor]"]').wpColorPicker('color', '#ededed');
1476
+ $('select[name="captionBuilder[title][bgColorTransparency]').val('1');
1477
+ $('input[name="captionBuilder[title][height]"]').val('33%');
1478
+ $('label[for="captBuilderTitlePositionCenterTop"]').trigger('click');
1479
+ $('input[name="captionBuilder[title][paddings][left]"]').val('10');
1480
+ $('input[name="captionBuilder[title][paddings][right]"]').val('10');
1481
+ $('input[name="captionBuilder[title][paddings][top]"]').val('0');
1482
+ $('input[name="captionBuilder[title][paddings][bottom]"]').val('15');
1483
+ $('input[name="captionBuilder[title][paddings][bottom]"]').val('15');
1484
+ var title = $('#captionBuilderTitleEnable'),
1485
+ description = $('#captionBuilderDescriptionEnable'),
1486
+ icons = $('#captionBuilderIconsEnable'),
1487
+ shadow = $('#showShadow');
1488
+ if(title.length && !title.is(':checked')) {
1489
+ title.trigger('click');
1490
+ title.prop('checked', true).iCheck('update');
1491
+ }
1492
+ if(description.length && description.is(':checked')) {
1493
+ description.trigger('click');
1494
+ description.prop('checked', false).iCheck('update');
1495
+ }
1496
+ if(icons.length && icons.is(':checked')) {
1497
+ icons.prop('checked', false).iCheck('update');
1498
+ icons.trigger('ifChanged');
1499
+ }
1500
+ if(shadow.length) {
1501
+ if(!shadow.is(':checked')) {
1502
+ shadow.prop('checked', true).iCheck('update');
1503
+ $('#hideShadow').prop('checked', false).iCheck('update');
1504
+ shadow.trigger('click');
1505
+ }
1506
+ $('input[name="thumbnail[shadow][color]"]').wpColorPicker('color', 'rgba(0, 0, 0, 1.0)');
1507
+ $('select[name="thumbnail[shadow][overlay]"]').val('0');
1508
+ $('input[name="thumbnail[shadow][blur]"]').val('15');
1509
+ $('input[name="thumbnail[shadow][x]"]').val('0');
1510
+ $('input[name="thumbnail[shadow][y]"]').val('4');
1511
+
1512
+ }
1513
+ };
1514
+
1515
  Controller.prototype.polaroidEffectSettings = function () {
1516
+ var self = this;
1517
  $('#polaroid-effect select').on('change', function(event) {
1518
  event.preventDefault();
1519
  var $overlayEffect = $('#overlayEffect').val()
1521
  if ($(this).val() == 'true') {
1522
  $polaroidSettings.removeClass('hidden');
1523
  if ($overlayEffect !== 'polaroid') {
1524
+ if(confirm('Caption Effect will change to Polaroid Style. Some settings, such as background Color, Transparency, caption paddings, as well as the shadows will be automatically changed.')) {
1525
+ self.setPolaroidDefaultSettings();
1526
+ $('#effectsPreview [data-grid-gallery-type="polaroid"]').trigger('click');
1527
+ }
1528
  }
1529
  } else {
1530
  $polaroidSettings.addClass('hidden');
2341
  $(document).on('click', '#preview .hi-icon.fa', function(event) {
2342
  event.preventDefault();
2343
  });
2344
+ $(document).one('input ifClicked', '.supsystic-plugin :input',function(event) {
2345
+ controller.settingsChanged = true;
2346
+ });
2347
+ app.SettingsController = controller;
2348
 
2349
  } else if(qs.module === 'galleries' && qs.action === 'view') {
2350
  var viewController = new ggSettingsView();
2464
  $style = $('<style/>', { id: styleId });
2465
  $('head').append($style);
2466
  }
2467
+ familyName = familyName.replace(/\s+/g, '+').replace(/"/g, '');
2468
 
2469
  var obj = document.getElementById(styleId),
2470
  sheet = obj.sheet || obj.styleSheet;
3173
  this.initOverlayShadow();
3174
  this.initSharedPropsForIcons();
3175
 
3176
+ if(typeof this.previewSettingsKeys == 'undefined') {
3177
+ this.previewSettingsKeys = {};
3178
+ }
3179
  this.objectsData = new sggDataSelectorsCache();
3180
  this.objectsData.init({
3181
  'keys': this.previewSettingsKeys,
3247
 
3248
  ImagePreview.prototype.initCaptionEffects = (function () {
3249
  var self = this, figure = $('#preview figure.grid-gallery-caption');
3250
+ figure.find('figcaption').css('height', '100%');
3251
 
3252
  if(figure.attr('data-grid-gallery-type') == 'polaroid') {
3253
  if (!this.defaultStyles) {
3323
  , $polaroidWrapper = $('.polaroid-bg-wrap')
3324
  , imageWidth
3325
  , imageHeight
3326
+ , builderHeight = $('input[name="captionBuilder[title][height]"]')
3327
+ , captionHeight = builderHeight.length ? builderHeight.val() : 0
3328
+ , clearHeight = captionHeight ? parseInt(captionHeight.toString().match(/\d.?\d*.?\d*/)[0]) : 0
3329
+ , figcaptionHeight = 0
3330
  ;
3331
 
3332
  if($galleryType.val() == 2) {
3342
  imageWidth = parseInt($polaroidWrapper.outerWidth()) - (frameWidth*2);
3343
  imageHeight = imageWidth / scaleRatio;
3344
  }
3345
+ if(!isNaN(clearHeight) && clearHeight != 0) {
3346
+ figcaptionHeight = (captionHeight.toString().indexOf('%') > 0 ? (imageHeight * clearHeight / 100) : clearHeight) + 'px';
3347
+ }
3348
+ $(this).find('.gg-caption-table').css('height', '1px');
3349
+ $(this).find('.gg-caption-row').css({'max-height': figcaptionHeight ? figcaptionHeight : '100%', 'height': 'auto'});
3350
+ $figcaption.css({'background': 'none', 'height': figcaptionHeight});
3351
+
3352
 
3353
  $img[0].style.setProperty('width', imageWidth + 'px', 'important');
3354
  $img[0].style.setProperty('height', imageHeight + 'px', 'important');
3355
  $img[0].style.setProperty('margin', '0 auto', 'important');
3356
  $img[0].style.setProperty('padding-top', frameWidth + 'px', 'important');
3357
+ $img[0].style.setProperty('padding-bottom', frameWidth + 'px', 'important');
3358
 
3359
  $(this).css({
3360
  'width': $(this).width(),
3361
  });
3362
 
3363
+ //$figcaption.css('padding', frameWidth + 'px');
3364
 
3365
  var $backgroundColor = $('input[name="thumbnail[overlay][background]"]').val()
3366
  , $transparency = $('select[name="thumbnail[overlay][transparency]"]').val()
3367
+ , css = hexToRgbA($backgroundColor, (10 - $transparency)/10);
3368
 
3369
  $(this).css({
3370
  'background-color': css
3371
  });
3372
+ //$(this).find('figcaption').css({'background': 'none'});
3373
 
3374
  if ($('#polaroid-scattering select').val() == 'true') {
3375
  $(this).css({
3385
  } else {
3386
  $('#preview .grid-gallery-caption').removeClass('polaroid-animation');
3387
  }
3388
+ if(builderHeight.length == 0) {
3389
+ $figcaption.css('height', 'auto');
3390
+ }
3391
  }else{
3392
  var $backgroundColor = $('input[name="thumbnail[overlay][background]"]').val()
3393
  , $transparency = $('select[name="thumbnail[overlay][transparency]"]').val()
3395
 
3396
  $(this).find('figcaption').css({'background-color': css});
3397
 
3398
+ var topRow = $(this).find('.gg-caption-row.top'),
3399
+ centerRow = $(this).find('.gg-caption-row.center');
3400
+ if(centerRow.length == 1) {
3401
+ if(topRow.length == 1) centerRow.css({'top': topRow.height(), 'transform': 'initial'});
3402
+ else centerRow.css({'top': '50%', 'transform': 'translateY(-50%)'});
3403
+ }
3404
  }
3405
  });
3406
  });
src/GridGallery/Galleries/configs/tooltips.php CHANGED
@@ -69,6 +69,7 @@ return array(
69
 
70
  'popupLinkedImageTextPro' => __('Here you may choose the type of the text, which appears under your linked images after opening them in a pop-up. You may add this text when you choose the linked images from your site media library. Empty text fields will appear at the right side of the page after selecting the image.', 'sgg'),
71
  'disableSourceImageForLiPro' => __('If this option is enabled, after clicking on the source image thumbnail, only linked images will appear in the pop-up box. The source image itself will not be displayed.', 'sgg'),
 
72
  'video.size' => __('Set video size in pop-up box (width x height)', 'sgg'),
73
  'video.autoplay' => __('If this option is enabled, video playback starts automatically as soon as pop-up box appears.', 'sgg'),
74
  'video.onEnd' => __('Here you can select, what happens when a video is over.', 'sgg'),
69
 
70
  'popupLinkedImageTextPro' => __('Here you may choose the type of the text, which appears under your linked images after opening them in a pop-up. You may add this text when you choose the linked images from your site media library. Empty text fields will appear at the right side of the page after selecting the image.', 'sgg'),
71
  'disableSourceImageForLiPro' => __('If this option is enabled, after clicking on the source image thumbnail, only linked images will appear in the pop-up box. The source image itself will not be displayed.', 'sgg'),
72
+ 'enableDownloadPhotosButtonPro' => __('If this option is enabled, the Download button will appear in pop-up box, which will allow you to download the original image.', 'sgg'),
73
  'video.size' => __('Set video size in pop-up box (width x height)', 'sgg'),
74
  'video.autoplay' => __('If this option is enabled, video playback starts automatically as soon as pop-up box appears.', 'sgg'),
75
  'video.onEnd' => __('Here you can select, what happens when a video is over.', 'sgg'),
src/GridGallery/Galleries/views/index.twig CHANGED
@@ -53,14 +53,20 @@
53
  <i class="fa fa-fw fa-pencil"></i>
54
  </td>
55
  <td>
56
- {% set cover = get_attachment(gallery.attachment_id, '155', '100', 'true') %}
 
 
 
 
57
 
58
  {% if cover|length < 1 %}
59
  {% if gallery.settings.posts.postCover|length > 1 %}
60
  {% set cover = gallery.settings.posts.postCover %}
61
  {% endif %}
62
  {% endif %}
63
- <img src="{{ cover|default('holder.js/350x220?theme=gray&text=' ~ gallery.title|raw) }}" alt="{{ gallery.title|raw }}" width="155px" height="100px"/>
 
 
64
  </td>
65
  <td>
66
  <input type="text" id="shortcode-{{ gallery.id }}" class="ggCopyTextCode shortcode" value="[supsystic-gallery id='{{ gallery.id }}']">
53
  <i class="fa fa-fw fa-pencil"></i>
54
  </td>
55
  <td>
56
+ {% if gallery.attachment_id == 0 and gallery.link_default|length > 1 %}
57
+ {% set cover = gallery.link_default %}
58
+ {% else %}
59
+ {% set cover = get_attachment(gallery.attachment_id, '155', '100', 'true') %}
60
+ {% endif %}
61
 
62
  {% if cover|length < 1 %}
63
  {% if gallery.settings.posts.postCover|length > 1 %}
64
  {% set cover = gallery.settings.posts.postCover %}
65
  {% endif %}
66
  {% endif %}
67
+ <div style="width:155px;height:100px;overflow:hidden;">
68
+ <img src="{{ cover|default('holder.js/350x220?theme=gray&text=' ~ gallery.title|raw) }}" alt="{{ gallery.title|raw }}" width="155px" height="100px" style="height:auto"/>
69
+ </div>
70
  </td>
71
  <td>
72
  <input type="text" id="shortcode-{{ gallery.id }}" class="ggCopyTextCode shortcode" value="[supsystic-gallery id='{{ gallery.id }}']">
src/GridGallery/Galleries/views/settings.twig CHANGED
@@ -177,7 +177,12 @@
177
  {% endif %}
178
  <img
179
  {% block gallery_preview_image_attributes %}
180
- src="{{ get_attachment(gallery.photos[0].attachment.id, width, height, crop, cropQuality) }}" data-src="{{ 'holder.js/350x250?theme=simple&text=' ~ gallery.title|raw }}" alt="{{ gallery.title|raw }}"
 
 
 
 
 
181
  style="
182
  max-width: 290px; max-height: 290px;
183
  {% if settings.area.photo_width_unit == 0 and settings.area.photo_width is not empty %}
@@ -1025,6 +1030,27 @@
1025
  </tr>
1026
  {% endblock %}
1027
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1028
  {# Hide popup captions #}
1029
  {{ form.row(translate('Hide Popup Captions'),
1030
  form.checkbox(
177
  {% endif %}
178
  <img
179
  {% block gallery_preview_image_attributes %}
180
+ {% if gallery.photos[0].attachment.isRemoteImage is defined and gallery.photos[0].attachment.isRemoteImage == 1 %}
181
+ src="{{ gallery.photos[0].attachment.thumbUrl }}"
182
+ {% else %}
183
+ src="{{ get_attachment(gallery.photos[0].attachment.id, width, height, crop, cropQuality) }}"
184
+ {% endif %}
185
+ data-src="{{ 'holder.js/350x250?theme=simple&text=' ~ gallery.title|raw }}" alt="{{ gallery.title|raw }}"
186
  style="
187
  max-width: 290px; max-height: 290px;
188
  {% if settings.area.photo_width_unit == 0 and settings.area.photo_width is not empty %}
1030
  </tr>
1031
  {% endblock %}
1032
 
1033
+ {# Enable Download Photos Button for Popup Images #}
1034
+ {% block enableDownloadPhotosButton %}
1035
+ <tr>
1036
+ <th scope="row">
1037
+ <label style="margin: 0 !important;">
1038
+ {{ translate('Enable Download Photos Button') }}
1039
+ {{ form.show_tooltip('enableDownloadPhotosButtonPro') }}
1040
+ <br />
1041
+ <label><a href="{{ getProUrl('utm_source=plugin&utm_medium=linkedImageText&utm_campaign=gallery') }}" target="_blank" style="color: #0074a2; font-size: 10px; text-decoration: none;">PRO Option</a> </label>
1042
+ </label>
1043
+ </th>
1044
+ <td>
1045
+ {{ form.checkbox(
1046
+ 'box[enableDownloadPhotosButtonFree]',
1047
+ '1',
1048
+ {'disabled':'disabled'}
1049
+ ) }}
1050
+ </td>
1051
+ </tr>
1052
+ {% endblock %}
1053
+
1054
  {# Hide popup captions #}
1055
  {{ form.row(translate('Hide Popup Captions'),
1056
  form.checkbox(
src/GridGallery/Galleries/views/shortcode/gallery.twig CHANGED
@@ -103,6 +103,9 @@
103
  data-polaroid-animation="{{ settings.thumbnail.overlay.polaroidAnimation | default('true') }}"
104
  data-polaroid-scattering="{{ settings.thumbnail.overlay.polaroidScattering | default('true') }}"
105
  data-polaroid-frame-width="{{ settings.thumbnail.overlay.polaroidFrameWidth | default(20) }}"
 
 
 
106
  {% endif %}
107
  {% if settings.area.grid == '3' %}
108
  data-responsive-colums="{{ settings.general.responsiveColumns|default("")|json_encode|e }}"
103
  data-polaroid-animation="{{ settings.thumbnail.overlay.polaroidAnimation | default('true') }}"
104
  data-polaroid-scattering="{{ settings.thumbnail.overlay.polaroidScattering | default('true') }}"
105
  data-polaroid-frame-width="{{ settings.thumbnail.overlay.polaroidFrameWidth | default(20) }}"
106
+ {% if settings.captionBuilder.enabled == '1' %}
107
+ data-polaroid-caption-height="{{ settings.captionBuilder.title.height | default(50) }}"
108
+ {% endif %}
109
  {% endif %}
110
  {% if settings.area.grid == '3' %}
111
  data-responsive-colums="{{ settings.general.responsiveColumns|default("")|json_encode|e }}"
src/GridGallery/Galleries/views/shortcode/helpers.twig CHANGED
@@ -237,7 +237,7 @@
237
 
238
  {% set var_image_attributes %}
239
  {% block image_attributes %}
240
- {% set imgSrcStr = previewImgUrl|trim|replace('/%20$/', '') %}
241
  {% set imgClassStr = 'ggImg' %}
242
  {% if settings.lazyload.enabled == '1' %}
243
  data-gg-real-image-href="{{ imgSrcStr }}"
@@ -250,6 +250,9 @@
250
  {% set imgClassStr = imgClassStr ~ ' ggLazyImg' %}
251
  {# {% endif %} #}
252
  {% endif %}
 
 
 
253
  src="{{ imgSrcStr }}"
254
  class="{{ imgClassStr }}"
255
  alt="{% if photo.attachment.alt is empty or photo.attachment.alt == " " %}{{ photo.attachment.title }}{% else %}{{ photo.attachment.alt }}{% endif %}"
237
 
238
  {% set var_image_attributes %}
239
  {% block image_attributes %}
240
+ {% set imgSrcStr = previewImgUrl|trim|replace('/%20$/', '')|htmlspecialchars_decode %}
241
  {% set imgClassStr = 'ggImg' %}
242
  {% if settings.lazyload.enabled == '1' %}
243
  data-gg-real-image-href="{{ imgSrcStr }}"
250
  {% set imgClassStr = imgClassStr ~ ' ggLazyImg' %}
251
  {# {% endif %} #}
252
  {% endif %}
253
+ {% if settings.area.grid == 2 or settings.area.grid == 3 or settings.area.grid == 4 %}
254
+ {% set imgClassStr = imgClassStr ~ ' ggNotInitImg' %}
255
+ {% endif %}
256
  src="{{ imgSrcStr }}"
257
  class="{{ imgClassStr }}"
258
  alt="{% if photo.attachment.alt is empty or photo.attachment.alt == " " %}{{ photo.attachment.title }}{% else %}{{ photo.attachment.alt }}{% endif %}"
src/GridGallery/Installer/Model.php CHANGED
@@ -41,7 +41,9 @@ class GridGallery_Installer_Model extends GridGallery_Core_BaseModel
41
  }
42
 
43
  foreach ($queries as $table => $query) {
44
- $this->delta($this->prefix($query));
 
 
45
  }
46
 
47
  return true;
@@ -59,7 +61,9 @@ class GridGallery_Installer_Model extends GridGallery_Core_BaseModel
59
  }
60
 
61
  foreach ($queries as $table => $query) {
62
- $this->dropTable($table);
 
 
63
  }
64
 
65
  return true;
@@ -72,12 +76,34 @@ class GridGallery_Installer_Model extends GridGallery_Core_BaseModel
72
  public function update($queries)
73
  {
74
  foreach ($queries as $table => $query) {
75
- if (!$this->tableExists($table)) {
76
- $this->delta($this->prefix($query));
 
 
 
 
77
  }
78
  }
79
  }
80
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
81
  protected function dropTable($table)
82
  {
83
  $importantTable = array(
41
  }
42
 
43
  foreach ($queries as $table => $query) {
44
+ if($this->isCreateTable($table)) {
45
+ $this->delta($this->prefix($query));
46
+ }
47
  }
48
 
49
  return true;
61
  }
62
 
63
  foreach ($queries as $table => $query) {
64
+ if($this->isCreateTable($table)) {
65
+ $this->dropTable($table);
66
+ }
67
  }
68
 
69
  return true;
76
  public function update($queries)
77
  {
78
  foreach ($queries as $table => $query) {
79
+ if($this->isCreateTable($table)) {
80
+ if(!$this->tableExists($table)) {
81
+ $this->delta($this->prefix($query));
82
+ }
83
+ } else {
84
+ $this->alterTable($table, $this->prefix($query));
85
  }
86
  }
87
  }
88
 
89
+ public function isCreateTable($table)
90
+ {
91
+ return strpos($table, '{prefix}') === 0;
92
+ }
93
+
94
+ public function alterTable($params, $query)
95
+ {
96
+ $parts = explode(':', $params);
97
+ if(sizeof($parts) != 3) return;
98
+
99
+ if($parts[0] == 'altercolumn') {
100
+ $existsColumn = $this->db->get_results('Show columns from `'.str_replace('{prefix}', $this->db->prefix, $parts[2]).'` like \''.$parts[1].'\'');
101
+ if(!$this->db->last_error && (!isset($existsColumn) || !is_array($existsColumn) || sizeof($existsColumn) == 0)) {
102
+ $this->db->query($query);
103
+ }
104
+ }
105
+ }
106
+
107
  protected function dropTable($table)
108
  {
109
  $importantTable = array(
src/GridGallery/Installer/Queries.php CHANGED
@@ -29,6 +29,10 @@
29
  `attachment_id` int(11) NOT NULL,
30
  `position` int(11) NOT NULL DEFAULT \'9000\',
31
  `timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
 
 
 
 
32
  PRIMARY KEY (`id`)
33
  ) AUTO_INCREMENT=0 DEFAULT CHARSET=utf8',
34
 
@@ -119,4 +123,10 @@
119
  `allow_use` TINYINT(1) NOT NULL DEFAULT 0,
120
  PRIMARY KEY (`gallery_id`)
121
  ) DEFAULT CHARSET=utf8',
 
 
 
 
 
 
122
  );
29
  `attachment_id` int(11) NOT NULL,
30
  `position` int(11) NOT NULL DEFAULT \'9000\',
31
  `timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
32
+ `link_type` TINYINT(4) NOT NULL DEFAULT 0,
33
+ `link_full` varchar(255) CHARACTER SET utf8 NOT NULL,
34
+ `link_thumb` varchar(255) CHARACTER SET utf8 NOT NULL,
35
+ `link_default` varchar(255) CHARACTER SET utf8 NOT NULL,
36
  PRIMARY KEY (`id`)
37
  ) AUTO_INCREMENT=0 DEFAULT CHARSET=utf8',
38
 
123
  `allow_use` TINYINT(1) NOT NULL DEFAULT 0,
124
  PRIMARY KEY (`gallery_id`)
125
  ) DEFAULT CHARSET=utf8',
126
+
127
+ 'altercolumn:link_type:{prefix}gg_photos' => 'ALTER TABLE `{prefix}gg_photos`
128
+ ADD COLUMN `link_type` TINYINT(4) NOT NULL DEFAULT 0,
129
+ ADD COLUMN `link_full` varchar(255) CHARACTER SET utf8 NOT NULL,
130
+ ADD COLUMN `link_thumb` varchar(255) CHARACTER SET utf8 NOT NULL,
131
+ ADD COLUMN `link_default` varchar(255) CHARACTER SET utf8 NOT NULL',
132
  );
src/GridGallery/Ui/Module.php CHANGED
@@ -77,6 +77,11 @@ class GridGallery_Ui_Module extends Rsc_Mvc_Module
77
  // really assigned to /app/assets/js/grid-gallery.js Handle
78
  wp_localize_script('sg-ajax.js', 'sggParams', array('isRtl' => (int) is_rtl()));
79
  wp_localize_script('sg-ajax.js', 'sggStandartFontsList', $this->getStandardFontsList());
 
 
 
 
 
80
  }
81
 
82
  public function getBackendJS() {
77
  // really assigned to /app/assets/js/grid-gallery.js Handle
78
  wp_localize_script('sg-ajax.js', 'sggParams', array('isRtl' => (int) is_rtl()));
79
  wp_localize_script('sg-ajax.js', 'sggStandartFontsList', $this->getStandardFontsList());
80
+ if($this->getEnvironment()->isPro()) {
81
+ if(version_compare($this->getEnvironment()->getConfig()->get('pro_plugin_version'), '2.7.6', '<')) {
82
+ wp_enqueue_script('webfont-js', '//ajax.googleapis.com/ajax/libs/webfont/1/webfont.js');
83
+ }
84
+ }
85
  }
86
 
87
  public function getBackendJS() {
src/GridGallery/Ui/views/type.twig CHANGED
@@ -197,7 +197,15 @@
197
  <input id="position-image-{{ image.id }}" type="text" disabled style="height:24px; width: 30px;" value="{{ image.position + 1 }}">
198
  </td>
199
  <td class="column-icon media-icon top-align">
200
- <a href="{{ image.attachment.sizes.full.url }}" data-colorbox>
 
 
 
 
 
 
 
 
201
  {% if image.attachment.sizes.thumbnail is empty %}
202
  {% set src = image.attachment.sizes.full.url %}
203
  {% if image.attachment.orientation == 'landscape' %}
@@ -210,7 +218,7 @@
210
  {% set sizes = { 'width': 90, 'height': 90 } %}
211
  {% endif %}
212
  <img width="100" height="100" data-original="{{ src }}"
213
- class="attachment-thumbnail supsystic-lazy" alt="{{ image.attachment.title }}">
214
  </a>
215
  </td>
216
  <td class="title column-title top-align" style="text-align: left; padding-left:15px !important;">
197
  <input id="position-image-{{ image.id }}" type="text" disabled style="height:24px; width: 30px;" value="{{ image.position + 1 }}">
198
  </td>
199
  <td class="column-icon media-icon top-align">
200
+ {% set remoteImgClass = "" %}
201
+ {% set remoteLinkClass = "" %}
202
+ {% set remoteImgType = "" %}
203
+ {% if image.attachment.isRemoteImage is defined and image.attachment.isRemoteImage == 1 %}
204
+ {% set remoteImgClass = " remote-thumbnail" %}
205
+ {% set remoteLinkClass = "remote-link" %}
206
+ {% set remoteImgType = ' data-cbox-photo=1' %}
207
+ {% endif %}
208
+ <a href="{{ image.attachment.sizes.full.url }}" data-colorbox class="{{ remoteLinkClass }}"{{ remoteImgType }}>
209
  {% if image.attachment.sizes.thumbnail is empty %}
210
  {% set src = image.attachment.sizes.full.url %}
211
  {% if image.attachment.orientation == 'landscape' %}
218
  {% set sizes = { 'width': 90, 'height': 90 } %}
219
  {% endif %}
220
  <img width="100" height="100" data-original="{{ src }}"
221
+ class="attachment-thumbnail supsystic-lazy{{ remoteImgClass }}" alt="{{ image.attachment.title }}">
222
  </a>
223
  </td>
224
  <td class="title column-title top-align" style="text-align: left; padding-left:15px !important;">