Plugin Directory

Changeset 2406959


Ignore:
Timestamp:
10/26/2020 05:41:35 PM (5 years ago)
Author:
wisersteps
Message:

v 1.0.7

Location:
free-sms-verification-for-gravity-forms/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • free-sms-verification-for-gravity-forms/trunk/app/assets/js/public-script.js

    r2380659 r2406959  
    2929            jQuery('.gf_firebase_user_token').val(user_token);
    3030            jQuery('.gf_firebase_api_key').val(firebaseConfig.apiKey);
     31            jQuery(".gf_google_sms_otp_field").attr("readonly", "readonly");
    3132        },
    3233        uiShown: function () {
     
    4142        {
    4243            provider: firebase.auth.PhoneAuthProvider.PROVIDER_ID,
     44            recaptchaParameters: {
     45                type: 'image', // 'audio'
     46                size: 'normal', // 'invisible' or 'compact'
     47                badge: 'bottomleft' //' bottomright' or 'inline' applies to invisible.
     48            },
    4349        },
    4450    ],
    4551};
    4652
    47 if (
    48     typeof firebase_data.firebase_countries !== 'undefined' &&
    49     firebase_data.firebase_countries.length > 0
    50 ) {
    51     uiConfig.signInOptions[0].defaultCountry =
    52         firebase_data.firebase_countries[0];
    53     uiConfig.signInOptions[0].whitelistedCountries =
    54         firebase_data.firebase_countries;
     53if (typeof firebase_data.firebase_countries !== 'undefined' && firebase_data.firebase_countries.length > 0) {
     54    uiConfig.signInOptions[0].whitelistedCountries = firebase_data.firebase_countries;
     55    if (typeof firebase_data.firebase_default_country === 'undefined' || firebase_data.firebase_default_country.length <= 0) {
     56        uiConfig.signInOptions[0].defaultCountry = firebase_data.firebase_countries[0];
     57    }
     58}
     59
     60if (typeof firebase_data.firebase_default_country !== 'undefined' && firebase_data.firebase_default_country.length > 0) {
     61    uiConfig.signInOptions[0].defaultCountry = firebase_data.firebase_default_country;
     62}
     63
     64if (typeof firebase_data.firebase_recpatcha_type !== 'undefined' && firebase_data.firebase_recpatcha_type.length > 0) {
     65    if (firebase_data.firebase_recpatcha_type === 'rec1') {
     66        uiConfig.signInOptions[0].recaptchaParameters.size = 'normal';
     67    } else {
     68        uiConfig.signInOptions[0].recaptchaParameters.size = 'invisible';
     69    }
    5570}
    5671
  • free-sms-verification-for-gravity-forms/trunk/app/partials/class-gf-sms-addon.php

    r2338253 r2406959  
    132132            if ( 'gf-free-sms-verification' === $field['type'] ) {
    133133                $firebase_countries = $field['firebase_countries'];
     134                $firebase_default_country = $field['firebase_default_country'];
     135                $firebase_recpatcha_type = $field['firebase_recpatcha_type'];
    134136                $exist              = true;
    135137            }
     
    165167            'firebaseConfig'     => $firebase_config,
    166168            'firebase_countries' => $firebase_countries,
     169            'firebase_default_country' => $firebase_default_country,
     170            'firebase_recpatcha_type'=>$firebase_recpatcha_type,
    167171        );
    168172        wp_localize_script( GF_FREE_SMS_VERIFICATION . 'public-script', 'firebase_data', $translation_array );
     
    244248    public function tooltips( $tooltips ) {
    245249        $simple_tooltips = array(
    246             'firebase_countries' => esc_html__( 'Choose the countries that will show (Leave empty to show all) <ul><li>Select the countries that will show up in the phone validation.</li><li>The first one will be the default.</li><li>Leave empty to show all countries.</li></ul>', 'gf-free-sms-verification' ),
     250            'firebase_countries' => esc_html__( 'Choose the countries that will show (Leave empty to show all)', 'gf-free-sms-verification' ),
    247251        );
    248252
    249253        return array_merge( $tooltips, $simple_tooltips );
     254    }
     255
     256
     257    public function settings_my_custom_field_type( $field, $echo = true ) {
     258        echo '<div>' . esc_html__( 'My custom field contains a few settings:', 'simpleaddon' ) . '</div>';
     259
     260        // get the text field settings from the main field and then render the text field
     261        $text_field = $field['args']['text'];
     262        $this->settings_text( $text_field );
     263
     264        // get the checkbox field settings from the main field and then render the checkbox field
     265        $checkbox_field = $field['args']['checkbox'];
     266        $this->settings_checkbox( $checkbox_field );
    250267    }
    251268
     
    278295                </select>
    279296            </li>
     297
     298
     299            <li class="firebase_default_country field_setting">
     300                <label for="firebase_default_country" class="section_label">
     301                    <?php esc_html_e( 'Firebase Default Country', 'gf-free-sms-verification' ); ?>
     302                    <?php gform_tooltip( 'firebase_default_country' ); ?>
     303                </label>
     304                <select class="gf_sms_select2" style="width:100%;" id="firebase_default_country" onkeyup="setDefaultCountry(jQuery(this).val());" onchange="setDefaultCountry(jQuery(this).val());">
     305                    <?php
     306                    foreach ( $this->get_whitelisted_countries() as $key => $val ) {
     307                        echo '<option value="' . esc_attr( $key ) . '">' . esc_attr( $val ) . '</option>';
     308                    }
     309                    ?>
     310                </select>
     311            </li>
     312
     313
     314
     315            <li class="firebase_recpatcha_type field_setting">
     316                <label for="firebase_recpatcha_type" class="section_label">
     317                    <?php esc_html_e( 'Firebase Recpatcha Type', 'gf-free-sms-verification' ); ?>
     318                    <?php gform_tooltip( 'firebase_recpatcha_type' ); ?>
     319                </label>
     320                <select style="width:100%;" id="firebase_recpatcha_type" onkeyup="setRecaptchaType(jQuery(this).val());" onchange="setRecaptchaType(jQuery(this).val());">
     321                    <option value="rec1">Recaptcha v2</option>
     322                    <option value="rec2">Invisible Recaptcha</option>
     323                </select>
     324            </li>
     325
    280326
    281327            <?php
  • free-sms-verification-for-gravity-forms/trunk/app/partials/class-gf-sms-field.php

    r2380659 r2406959  
    5757            'placeholder_setting',
    5858            'firebase_countries',
     59            'firebase_default_country',
     60            'firebase_recpatcha_type',
    5961            'css_class_setting',
    6062            'size_setting',
     
    8890        $script .= "jQuery(document).bind('gform_load_field_settings', function (event, field, form) {" .
    8991        "var firebase_countries = field.firebase_countries == undefined ? '' : field.firebase_countries;" .
     92        "var firebase_default_country = field.firebase_default_country == undefined ? '' : field.firebase_default_country;" .
     93        "var firebase_recpatcha_type = field.firebase_recpatcha_type == undefined ? '' : field.firebase_recpatcha_type;" .
    9094        "jQuery('#firebase_countries').val(firebase_countries).trigger('change');" .
     95        "jQuery('#firebase_recpatcha_type').val(firebase_recpatcha_type).trigger('change');" .
     96        "jQuery('#firebase_default_country').val(firebase_default_country).trigger('change');" .
    9197        '});' . PHP_EOL;
    9298
    9399        // saving the simple setting.
    94100        $script .= "function setWhitelistedCountries(value) {SetFieldProperty('firebase_countries', value);}" . PHP_EOL;
     101        $script .= "function setDefaultCountry(value) {SetFieldProperty('firebase_default_country', value);}" . PHP_EOL;
     102        $script .= "function setRecaptchaType(value) {SetFieldProperty('firebase_recpatcha_type', value);}" . PHP_EOL;
    95103        return $script;
    96104    }
     
    127135        $required_attribute    = $this->isRequired ? 'aria-required="true"' : '';
    128136        $invalid_attribute     = $this->failed_validation ? 'aria-invalid="true"' : 'aria-invalid="false"';
    129         $disabled_text         = $is_form_editor ? 'disabled="disabled"' : '';
     137        $disabled_text         = $is_form_editor ? : '';
    130138
    131139        // Prepare the input tag for this field.
  • free-sms-verification-for-gravity-forms/trunk/gf-free-sms-verification.php

    r2382157 r2406959  
    44 * Plugin URI: https://www.wisersteps.com
    55 * Description: The best free SMS verification plugin for Gravity Forms, Verify users numbers before submitting the forms, Use Google firebase to edit the sent message to phone numbers by adding your website name.
    6  * Version: 1.0.6
     6 * Version: 1.0.7
    77 * Author: WiserSteps
    88 * Author URI: https://www.wisersteps.com
     
    2424// Define Name & Version.
    2525define( 'GF_FREE_SMS_VERIFICATION', 'gf-free-sms-verification' );
    26 define( 'GF_FREE_SMS_VERIFICATION_VERSION', '1.0.6' );
     26define( 'GF_FREE_SMS_VERIFICATION_VERSION', '1.0.7' );
    2727define( 'GF_FREE_SMS_VERIFICATION_PATH', plugin_basename( __FILE__ ) );
    2828
  • free-sms-verification-for-gravity-forms/trunk/readme.txt

    r2382157 r2406959  
    44Tags: gravity forms sms, graivty forms otp, gravity forms firebase, gravity forms verification, form sms otp
    55Requires at least: 4.7
    6 Tested up to: 5.4
    7 Stable tag: 1.0.6
     6Tested up to: 5.5.1
     7Stable tag: 1.0.7
    88Requires PHP: 5.6
    99License: GPLv2 or later
     
    6969= 1.0.6 =
    7070* Fix activation on multisite
     71
     72= 1.0.7 =
     73* Add invisible recpatcha option
     74* Add default country option
     75* Make field disabled after validation
Note: See TracChangeset for help on using the changeset viewer.