Changeset 2406959
- Timestamp:
- 10/26/2020 05:41:35 PM (5 years ago)
- Location:
- free-sms-verification-for-gravity-forms/trunk
- Files:
-
- 5 edited
-
app/assets/js/public-script.js (modified) (2 diffs)
-
app/partials/class-gf-sms-addon.php (modified) (4 diffs)
-
app/partials/class-gf-sms-field.php (modified) (3 diffs)
-
gf-free-sms-verification.php (modified) (2 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
free-sms-verification-for-gravity-forms/trunk/app/assets/js/public-script.js
r2380659 r2406959 29 29 jQuery('.gf_firebase_user_token').val(user_token); 30 30 jQuery('.gf_firebase_api_key').val(firebaseConfig.apiKey); 31 jQuery(".gf_google_sms_otp_field").attr("readonly", "readonly"); 31 32 }, 32 33 uiShown: function () { … … 41 42 { 42 43 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 }, 43 49 }, 44 50 ], 45 51 }; 46 52 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; 53 if (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 60 if (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 64 if (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 } 55 70 } 56 71 -
free-sms-verification-for-gravity-forms/trunk/app/partials/class-gf-sms-addon.php
r2338253 r2406959 132 132 if ( 'gf-free-sms-verification' === $field['type'] ) { 133 133 $firebase_countries = $field['firebase_countries']; 134 $firebase_default_country = $field['firebase_default_country']; 135 $firebase_recpatcha_type = $field['firebase_recpatcha_type']; 134 136 $exist = true; 135 137 } … … 165 167 'firebaseConfig' => $firebase_config, 166 168 'firebase_countries' => $firebase_countries, 169 'firebase_default_country' => $firebase_default_country, 170 'firebase_recpatcha_type'=>$firebase_recpatcha_type, 167 171 ); 168 172 wp_localize_script( GF_FREE_SMS_VERIFICATION . 'public-script', 'firebase_data', $translation_array ); … … 244 248 public function tooltips( $tooltips ) { 245 249 $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' ), 247 251 ); 248 252 249 253 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 ); 250 267 } 251 268 … … 278 295 </select> 279 296 </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 280 326 281 327 <?php -
free-sms-verification-for-gravity-forms/trunk/app/partials/class-gf-sms-field.php
r2380659 r2406959 57 57 'placeholder_setting', 58 58 'firebase_countries', 59 'firebase_default_country', 60 'firebase_recpatcha_type', 59 61 'css_class_setting', 60 62 'size_setting', … … 88 90 $script .= "jQuery(document).bind('gform_load_field_settings', function (event, field, form) {" . 89 91 "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;" . 90 94 "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');" . 91 97 '});' . PHP_EOL; 92 98 93 99 // saving the simple setting. 94 100 $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; 95 103 return $script; 96 104 } … … 127 135 $required_attribute = $this->isRequired ? 'aria-required="true"' : ''; 128 136 $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 ? : ''; 130 138 131 139 // Prepare the input tag for this field. -
free-sms-verification-for-gravity-forms/trunk/gf-free-sms-verification.php
r2382157 r2406959 4 4 * Plugin URI: https://www.wisersteps.com 5 5 * 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. 66 * Version: 1.0.7 7 7 * Author: WiserSteps 8 8 * Author URI: https://www.wisersteps.com … … 24 24 // Define Name & Version. 25 25 define( 'GF_FREE_SMS_VERIFICATION', 'gf-free-sms-verification' ); 26 define( 'GF_FREE_SMS_VERIFICATION_VERSION', '1.0. 6' );26 define( 'GF_FREE_SMS_VERIFICATION_VERSION', '1.0.7' ); 27 27 define( 'GF_FREE_SMS_VERIFICATION_PATH', plugin_basename( __FILE__ ) ); 28 28 -
free-sms-verification-for-gravity-forms/trunk/readme.txt
r2382157 r2406959 4 4 Tags: gravity forms sms, graivty forms otp, gravity forms firebase, gravity forms verification, form sms otp 5 5 Requires at least: 4.7 6 Tested up to: 5. 47 Stable tag: 1.0. 66 Tested up to: 5.5.1 7 Stable tag: 1.0.7 8 8 Requires PHP: 5.6 9 9 License: GPLv2 or later … … 69 69 = 1.0.6 = 70 70 * 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.