Skip to content
This repository has been archived by the owner on Mar 14, 2021. It is now read-only.

Commit

Permalink
Merge pull request #272 from Codeinwp/development
Browse files Browse the repository at this point in the history
Added missing Loader.gif file
Fixed undefined notice
Fix submit button leaving form when ReCaptcha is enabled
  • Loading branch information
abaicus authored Feb 15, 2018
2 parents f4de2bb + 36865df commit 7e135b5
Show file tree
Hide file tree
Showing 9 changed files with 55 additions and 34 deletions.
Binary file added admin/img/loader.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 3 additions & 1 deletion admin/partials/pirateforms-settings-sidebar-subscribe.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ class="btn"><?php esc_html_e( 'View more features', 'pirate-forms' ); ?></a>
<div class="pirate-forms-subscribe-content">
<?php
if ( ! empty( $_POST['pirate_forms_mail'] ) ) {
require( PIRATE_FORMS_PATH . 'mailin.php' );
if ( ! class_exists( 'Mailin' ) ) {
require_once PIRATEFORMS_DIR . 'vendor/mailin-api/mailin-api-php/V2.0/Mailin.php';
}
$user_info = get_userdata( 1 );
$mailin = new Mailin( 'https://api.sendinblue.com/v2.0', 'cHW5sxZnzE7mhaYb' );
$data = array(
Expand Down
7 changes: 4 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"authors": [
{
"name": "ThemeIsle Team",
"email": "[email protected].com",
"email": "[email protected]",
"homepage": "https://themeisle.com"
}
],
Expand All @@ -21,7 +21,8 @@
},
"require": {
"codeinwp/themeisle-sdk": "master",
"xrstf/composer-php52": "^1.0.20"
"xrstf/composer-php52": "^1.0.20",
"mailin-api/mailin-api-php": "master"
},
"minimum-stability": "dev",
"prefer-stable": true,
Expand All @@ -36,4 +37,4 @@
"xrstf\\Composer52\\Generator::onPostInstallCmd"
]
}
}
}
2 changes: 1 addition & 1 deletion includes/class-pirateforms.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class PirateForms {
public function __construct() {

$this->plugin_name = 'pirateforms';
$this->version = '2.3.3';
$this->version = '2.3.4';

$this->load_dependencies();
$this->set_locale();
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "pirate-forms",
"version": "2.3.3",
"version": "2.3.4",
"description": "Pirate Forms plugin",
"repository": {
"type": "git",
Expand Down
4 changes: 2 additions & 2 deletions pirate-forms.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* Plugin Name: Free & Simple Contact Form Plugin - Pirateforms
* Plugin URI: http://themeisle.com/plugins/pirate-forms/
* Description: Easily creates a nice looking, simple contact form on your WP site.
* Version: 2.3.3
* Version: 2.3.4
* Author: Themeisle
* Author URI: http://themeisle.com
* Text Domain: pirate-forms
Expand All @@ -36,7 +36,7 @@
define( 'PIRATEFORMS_NAME', 'Pirate Forms' );
define( 'PIRATEFORMS_SLUG', 'pirate-forms' );
define( 'PIRATEFORMS_USELL_LINK', 'https://themeisle.com/plugins/pirate-forms-extended/' );
define( 'PIRATE_FORMS_VERSION', '2.3.3' );
define( 'PIRATE_FORMS_VERSION', '2.3.4' );
define( 'PIRATEFORMS_DIR', trailingslashit( plugin_dir_path( __FILE__ ) ) );
define( 'PIRATEFORMS_URL', plugin_dir_url( __FILE__ ) );
define( 'PIRATEFORMS_BASENAME', plugin_basename( __FILE__ ) );
Expand Down
6 changes: 3 additions & 3 deletions public/class-pirateforms-public.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public function enqueue_styles_and_scripts() {
$deps = array( 'jquery' );
$pirate_forms_options = get_option( 'pirate_forms_settings_array' );
if ( ! empty( $pirate_forms_options ) ) :
if ( ! empty( $pirate_forms_options['pirateformsopt_recaptcha_secretkey'] ) && ! empty( $pirate_forms_options['pirateformsopt_recaptcha_sitekey'] ) && 'yes' === $pirate_forms_options['pirateformsopt_recaptcha_field'] ) :
if ( ! empty( $pirate_forms_options['pirateformsopt_recaptcha_secretkey'] ) && ! empty( $pirate_forms_options['pirateformsopt_recaptcha_sitekey'] ) && ! empty( $pirate_forms_options['pirateformsopt_recaptcha_field'] ) && ( 'yes' === $pirate_forms_options['pirateformsopt_recaptcha_field'] ) ) :
if ( defined( 'POLYLANG_VERSION' ) && function_exists( 'pll_current_language' ) ) {
$pirate_forms_contactus_language = pll_current_language();
} else {
Expand Down Expand Up @@ -324,7 +324,7 @@ public function display_form( $atts, $content = null ) {
endif;
/**
******* ReCaptcha */
if ( ! empty( $pirate_forms_options['pirateformsopt_recaptcha_secretkey'] ) && ! empty( $pirate_forms_options['pirateformsopt_recaptcha_sitekey'] ) && 'yes' === $pirate_forms_options['pirateformsopt_recaptcha_field'] ) :
if ( ! empty( $pirate_forms_options['pirateformsopt_recaptcha_secretkey'] ) && ! empty( $pirate_forms_options['pirateformsopt_recaptcha_sitekey'] ) && ! empty( $pirate_forms_options['pirateformsopt_recaptcha_field'] ) && ( 'yes' === $pirate_forms_options['pirateformsopt_recaptcha_field'] ) ) :
$pirateformsopt_recaptcha_sitekey = $pirate_forms_options['pirateformsopt_recaptcha_sitekey'];
$pirateformsopt_recaptcha_secretkey = $pirate_forms_options['pirateformsopt_recaptcha_secretkey'];
$elements[] = array(
Expand All @@ -340,7 +340,7 @@ public function display_form( $atts, $content = null ) {
);
endif;

if ( 'custom' === $pirate_forms_options['pirateformsopt_recaptcha_field'] ) :
if ( ! empty( $pirate_forms_options['pirateformsopt_recaptcha_field'] ) && ( 'custom' === $pirate_forms_options['pirateformsopt_recaptcha_field'] ) ) :
$elements[] = array(
'type' => 'div',
'class' => 'pirate-forms-maps-custom', // spam.reverse() = maps
Expand Down
21 changes: 13 additions & 8 deletions public/css/front.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Version: 2.3.3
Version: 2.3.4
*/
.pirate_forms_wrap .form_field_wrap,
.widget .pirate_forms_wrap .form_field_wrap {
Expand Down Expand Up @@ -39,20 +39,24 @@ Version: 2.3.3
text-align: right;
}

.pirate-forms-maps-custom {
min-width: 150px;
}

.pirate-forms-maps-custom input {
display: inline;
width: auto;
}

.pirate-forms-maps-custom label {
display: inline-block;
display: inline;
cursor: pointer;
}

.pirate-forms-maps-custom span {
margin-left: 5px;
}

.pirate-forms-fields-container {
margin-right: -15px;
margin-left: -15px;
}

.pirate-forms-fields-container .form_field_wrap {
box-sizing: border-box;
padding-right: 15px;
Expand All @@ -75,7 +79,6 @@ Version: 2.3.3
.pirate_forms_wrap .form_field_wrap .pirate-forms-submit-button {
display: inline-block;
width: auto;
max-width: 100%;
}

.pirate_forms_wrap .pirate-forms-footer {
Expand All @@ -85,10 +88,12 @@ Version: 2.3.3
}

.pirate_forms_wrap .pirate-forms-footer .form_field_wrap {
width: auto;
display: table-cell;
float: none;
margin: 0;
vertical-align: middle;
padding-bottom: 10px;
}

@media (max-width: 480px) {
Expand Down
43 changes: 28 additions & 15 deletions public/js/scripts.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,31 @@
/* global jQuery */
jQuery(document).ready(function() {
jQuery( document ).ready( function () {
'use strict';
jQuery( '.pirate-forms-file-upload-button' ).on( 'click', function () {
var $button = jQuery( this );
$button.parent().find( 'input[type=file]' ).on( 'change', function () {
$button.parent().find( 'input[type=text]' ).val( jQuery( this ).val() ).change();
} );
$button.parent().find( 'input[type=file]' ).focus().click();
} );

jQuery('.pirate-forms-file-upload-button').on('click', function () {
var $button = jQuery(this);
$button.parent().find('input[type=file]').on('change', function(){
$button.parent().find('input[type=text]').val(jQuery(this).val()).change();
});
$button.parent().find('input[type=file]').focus().click();
});
jQuery( '.pirate-forms-file-upload-input' ).on( 'click', function () {
jQuery( this ).parent().find( '.pirate-forms-file-upload-button' ).trigger( 'click' );
} );
jQuery( '.pirate-forms-file-upload-input' ).on( 'focus', function () {
jQuery( this ).blur();
} );
} );

jQuery('.pirate-forms-file-upload-input').on('click', function(){
jQuery(this).parent().find('.pirate-forms-file-upload-button').trigger('click');
});
jQuery('.pirate-forms-file-upload-input').on('focus', function(){
jQuery(this).blur();
});
});
jQuery( window ).load( function () {
'use strict';
if ( jQuery( '.pirate_forms_wrap' ).length ) {
jQuery( '.pirate_forms_wrap' ).each( function () {
var formWidth = jQuery( this ).innerWidth();
var footerWidth = jQuery( this ).find( '.pirate-forms-footer' ).innerWidth();
if ( footerWidth > formWidth ) {
jQuery( this ).find( '.contact_submit_wrap, .form_captcha_wrap, .pirateform_wrap_classes_spam_wrap' ).css( {'text-align' : 'left', 'display' : 'block' } );
}
} );
}
} );

0 comments on commit 7e135b5

Please sign in to comment.