Skip to content

Commit

Permalink
Update plugin: gf-image-choices.
Browse files Browse the repository at this point in the history
Old Version: 1.4.26
New Version: 1.5.4

See #3474.
  • Loading branch information
boonebgorges committed Dec 26, 2024
1 parent 08451fa commit 014d738
Show file tree
Hide file tree
Showing 22 changed files with 1,299 additions and 675 deletions.
1,826 changes: 1,222 additions & 604 deletions wp-content/plugins/gf-image-choices/class-gf-image-choices.php

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions wp-content/plugins/gf-image-choices/gf-image-choices.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
Plugin URI: https://jetsloth.com/gravity-forms-image-choices/
Description: Easily add images as choices for Radio Buttons or Checkboxes fields in your Gravity Forms, including Survey, Quiz, Product and Option fields that have their field type set to Radio Buttons or Checkboxes
Author: JetSloth
Version: 1.4.26
Version: 1.5.4
Requires at least: 3.5
Tested up to: 6.5.2
Tested up to: 6.6.2
Author URI: https://jetsloth.com
License: GPL2
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Expand All @@ -30,16 +30,16 @@
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/

define('GFIC_VERSION', '1.4.26');
define('GFIC_VERSION', '1.5.4');
define('GFIC_HOME', 'https://jetsloth.com');
define('GFIC_NAME', 'Gravity Forms Image Choices');
define('GFIC_SLUG', 'gf-image-choices');
define('GFIC_AUTHOR', 'JetSloth');
define('GFIC_TIMEOUT', 20);
define('GFIC_SSL_VERIFY', false);

define('GFIC_SPLASH_ID', 'gfic_1_4_splash');
define('GFIC_SPLASH_URL', 'https://jetsloth.com/splash-page/image-choices-1-4/');
define('GFIC_SPLASH_ID', 'gfic_1_5_splash');
define('GFIC_SPLASH_URL', 'https://jetsloth.com/splash-page/image-choices-1-5/');

add_action( 'gform_loaded', array( 'GF_Image_Choices_Bootstrap', 'load' ), 5 );

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion wp-content/plugins/gf-image-choices/js/gf_image_choices.js

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

110 changes: 58 additions & 52 deletions wp-content/plugins/gf-image-choices/js/jetsloth-lightbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@
{
'use strict';

$.fn.jetslothLightbox = function( options )
{

var options = $.extend({
window.jetslothLightboxDefaults = gform.applyFilters('gfic_lightbox_defaults', {
sourceAttr: 'href',
overlay: true,
spinner: true,
Expand All @@ -33,6 +30,7 @@ $.fn.jetslothLightbox = function( options )
animationSpeed: 250,
preloading: true,
enableKeyboard: true,
enableSwipe: true,
loop: true,
rel: false,
docClose: true,
Expand All @@ -48,9 +46,12 @@ $.fn.jetslothLightbox = function( options )
additionalHtml: false,
history: true,
throttleInterval: 0
}, options);
});

//console.log('lightbox options', options);
$.fn.jetslothLightbox = function( options )
{

var options = $.extend(window.jetslothLightboxDefaults, options);

// global variables
var touchDevice = ( 'ontouchstart' in window ),
Expand Down Expand Up @@ -359,54 +360,59 @@ $.fn.jetslothLightbox = function( options )
mousedown = false,
imageLeft = 0;

image
.on( 'touchstart.'+prefix+' mousedown.'+prefix, function(e)
{
if(mousedown) return true;
if( canTransisions ) imageLeft = parseInt( image.css( 'left' ) );
mousedown = true;
swipeDiff = 0;
swipeYDiff = 0;
swipeStart = e.originalEvent.pageX || e.originalEvent.touches[ 0 ].pageX;
swipeYStart = e.originalEvent.pageY || e.originalEvent.touches[ 0 ].pageY;
return false;
})
.on( 'touchmove.'+prefix+' mousemove.'+prefix+' pointermove MSPointerMove', function(e)
{
if(!mousedown) return true;
e.preventDefault();
swipeEnd = e.originalEvent.pageX || e.originalEvent.touches[ 0 ].pageX;
swipeYEnd = e.originalEvent.pageY || e.originalEvent.touches[ 0 ].pageY;
swipeDiff = swipeStart - swipeEnd;
swipeYDiff = swipeYStart - swipeYEnd;
if( options.animationSlide ) {
if( canTransisions ) slide( 0, -swipeDiff + 'px' );
else image.css( 'left', imageLeft - swipeDiff + 'px' );
}
})
.on( 'touchend.'+prefix+' mouseup.'+prefix+' touchcancel.'+prefix+' mouseleave.'+prefix+' pointerup pointercancel MSPointerUp MSPointerCancel',function(e)
{
if(mousedown){
mousedown = false;
var possibleDir = true;
if(!options.loop) {
if(index === 0 && swipeDiff < 0){ possibleDir = false; }
if(index >= objects.length -1 && swipeDiff > 0) { possibleDir = false; }
}
if( Math.abs( swipeDiff ) > options.swipeTolerance && possibleDir ) {
loadImage( swipeDiff > 0 ? 1 : -1 );
}
else if( options.animationSlide )
if ( options.enableSwipe ) {

image
.on( 'touchstart.'+prefix+' mousedown.'+prefix, function(e)
{
if( canTransisions ) slide( options.animationSpeed / 1000, 0 + 'px' );
else image.animate({ 'left': imageLeft + 'px' }, options.animationSpeed / 2 );
}
if(mousedown) return true;
if( canTransisions ) imageLeft = parseInt( image.css( 'left' ) );
mousedown = true;
swipeDiff = 0;
swipeYDiff = 0;
swipeStart = e.originalEvent.pageX || e.originalEvent.touches[ 0 ].pageX;
swipeYStart = e.originalEvent.pageY || e.originalEvent.touches[ 0 ].pageY;
return false;
})
.on( 'touchmove.'+prefix+' mousemove.'+prefix+' pointermove MSPointerMove', function(e)
{
if(!mousedown) return true;
e.preventDefault();
swipeEnd = e.originalEvent.pageX || e.originalEvent.touches[ 0 ].pageX;
swipeYEnd = e.originalEvent.pageY || e.originalEvent.touches[ 0 ].pageY;
swipeDiff = swipeStart - swipeEnd;
swipeYDiff = swipeYStart - swipeYEnd;
if( options.animationSlide ) {
if( canTransisions ) slide( 0, -swipeDiff + 'px' );
else image.css( 'left', imageLeft - swipeDiff + 'px' );
}
})
.on( 'touchend.'+prefix+' mouseup.'+prefix+' touchcancel.'+prefix+' mouseleave.'+prefix+' pointerup pointercancel MSPointerUp MSPointerCancel',function(e)
{
if(mousedown){
mousedown = false;
var possibleDir = true;
if(!options.loop) {
if(index === 0 && swipeDiff < 0){ possibleDir = false; }
if(index >= objects.length -1 && swipeDiff > 0) { possibleDir = false; }
}
if( Math.abs( swipeDiff ) > options.swipeTolerance && possibleDir ) {
loadImage( swipeDiff > 0 ? 1 : -1 );
}
else if( options.animationSlide )
{
if( canTransisions ) slide( options.animationSpeed / 1000, 0 + 'px' );
else image.animate({ 'left': imageLeft + 'px' }, options.animationSpeed / 2 );
}

if( options.swipeClose && Math.abs(swipeYDiff) > 50 && Math.abs( swipeDiff ) < options.swipeTolerance) {
close();
}
}
});

}

if( options.swipeClose && Math.abs(swipeYDiff) > 50 && Math.abs( swipeDiff ) < options.swipeTolerance) {
close();
}
}
});
},
removeEvents = function(){
nav.off('click', 'button');
Expand Down
4 changes: 2 additions & 2 deletions wp-content/plugins/gf-image-choices/readme.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
=== Gravity Forms Image Choices ===
Version: 1.4.26
Version: 1.5.4
Author: JetSloth
Requires at least: 3.5
Tested up to: 6.5.2
Tested up to: 6.6.2
Author URI: https://jetsloth.com
License: GPL2
License URI: http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
Expand Down

0 comments on commit 014d738

Please sign in to comment.