Changeset 1758139
- Timestamp:
- 11/03/2017 05:18:04 PM (8 years ago)
- Location:
- international-telephone-input-for-contact-form-7/trunk
- Files:
-
- 6 edited
-
form-tag.php (modified) (3 diffs)
-
functions.php (modified) (1 diff)
-
mail-tags.php (modified) (1 diff)
-
readme.txt (modified) (4 diffs)
-
script.js (modified) (1 diff)
-
script.min.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
international-telephone-input-for-contact-form-7/trunk/form-tag.php
r1572579 r1758139 68 68 $atts_country_code['name'] = $tag->name . '-cf7it-country-code'; 69 69 $atts_country_code['class'] = 'wpcf7-intl-tel-country-code'; 70 71 $atts_country_iso=array(); 72 $atts_country_iso['type'] = 'hidden'; 73 $atts_country_iso['name'] = $tag->name . '-cf7it-country-iso2'; 74 $atts_country_iso['class'] = 'wpcf7-intl-tel-country-iso2'; 70 75 71 76 $atts = wpcf7_format_atts( $atts ); … … 73 78 $atts_country = wpcf7_format_atts( $atts_country ); 74 79 $atts_country_code = wpcf7_format_atts( $atts_country_code ); 80 $atts_country_iso= wpcf7_format_atts( $atts_country_iso); 75 81 76 82 $html = sprintf( 77 '<span class="wpcf7-form-control-wrap %1$s"><input %2$s /><input %3$s /><input %5$s /><input %6$s /> %4$s</span>',78 sanitize_html_class( $tag->name ), $atts, $atts_hidden, $validation_error, $atts_country, $atts_country_code );83 '<span class="wpcf7-form-control-wrap %1$s"><input %2$s /><input %3$s /><input %5$s /><input %6$s /><input %7$s />%4$s</span>', 84 sanitize_html_class( $tag->name ), $atts, $atts_hidden, $validation_error, $atts_country, $atts_country_code, $atts_country_iso ); 79 85 80 86 return $html; … … 87 93 } 88 94 89 wp_enqueue_script( 'wpcf7-intl-tel-lib-js', 'https://cdnjs.cloudflare.com/ajax/libs/intl-tel-input/ 7.0.1/js/intlTelInput'.$extension , array( 'jquery' ), '7.0.1', true);90 wp_enqueue_style( 'wpcf7-intl-tel-css', 'https://cdnjs.cloudflare.com/ajax/libs/intl-tel-input/ 7.0.1/css/intlTelInput.css', '', '7.0.1', 'all');95 wp_enqueue_script( 'wpcf7-intl-tel-lib-js', 'https://cdnjs.cloudflare.com/ajax/libs/intl-tel-input/12.1.3/js/intlTelInput'.$extension , array( 'jquery' ), '12.1.3', true); 96 wp_enqueue_style( 'wpcf7-intl-tel-css', 'https://cdnjs.cloudflare.com/ajax/libs/intl-tel-input/12.1.3/css/intlTelInput.css', '', '12.1.3', 'all'); 91 97 wp_enqueue_script( 'wpcf7-intl-tel-js', plugins_url( 'script'.$extension, __FILE__ ), array('jquery', 'wpcf7-intl-tel-lib-js'), '1.4.0', true); 92 wp_localize_script( 'wpcf7-intl-tel-js', 'wpcf7_utils_url', 'https://cdnjs.cloudflare.com/ajax/libs/intl-tel-input/ 7.0.1/lib/libphonenumber/build/utils.js' );98 wp_localize_script( 'wpcf7-intl-tel-js', 'wpcf7_utils_url', 'https://cdnjs.cloudflare.com/ajax/libs/intl-tel-input/12.1.3/js/utils.js' ); 93 99 } 94 100 -
international-telephone-input-for-contact-form-7/trunk/functions.php
r1572582 r1758139 3 3 * Plugin Name: International Telephone Input for Contact Form 7 4 4 * Plugin URI: https://www.facebook.com/damiarita 5 * Description: This plugins uses a jQuery plugin called Internationa Telephone Input to add the capability to choose in a falg dropdow your country code6 * Version: 1. 4.65 * Description: This plugins uses a jQuery plugin called International Telephone Input to add the capability to choose in a falg dropdow your country code 6 * Version: 1.5.0 7 7 * Author: Damià Rita 8 8 * Author URI: https://www.facebook.com/damiarita -
international-telephone-input-for-contact-form-7/trunk/mail-tags.php
r1535510 r1758139 6 6 if ( wpcf7_intl_tel_ends_with($name, '-cf7it-national') ): 7 7 return wpcf7_intl_tel_recover_field( $name ); 8 endif;8 endif; 9 9 if ( wpcf7_intl_tel_ends_with($name, '-cf7it-country-code') ): 10 10 return wpcf7_intl_tel_recover_field( $name ); 11 endif;11 endif; 12 12 if( wpcf7_intl_tel_ends_with($name, '-cf7it-country-name') ): 13 return wpcf7_intl_tel_recover_field( $name ); 14 endif; 15 if( wpcf7_intl_tel_ends_with($name, '-cf7it-country-iso2') ): 13 16 return wpcf7_intl_tel_recover_field( $name ); 14 17 endif; -
international-telephone-input-for-contact-form-7/trunk/readme.txt
r1599008 r1758139 3 3 Tags: css, javascript, jQuery, contact form 7, international, i18n, international code, country code, telephone 4 4 Stable tag: trunk 5 Requires at least: 1. 4.36 Tested up to: 4. 75 Requires at least: 1.5.0 6 Tested up to: 4.8.3 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 14 14 Addon Contact Form 7 that creates a new kind of input that allows the user to select a country of his telephone numnerContact Form 7 addon that creates a new kind of input that allows the user to select a country of his telephone numner 15 15 16 This plugin will use a jQuery plugin called [International Telephone Input](http://jackocnr.com/intl-tel-input.html) to create a new type of input for Contact Form 7 that shows country flags to write a prefix of the telephone number. 17 18 = How to use it? = 19 20 Once you have installed and activated your plugin, a new type of field will be available in your Contact Form 7 forms. In order to add it to your form, you can either click on the "International Telephone" button above your form editor, or add the shortcode like: [intl_tel* {your-phone}] ({your-phone} has to be replaced by the name you want to give the field and * is optional and makes the field compulsory) 21 22 To recover the field's info on your email, use this tag: [{your-phone}]. It will print something like +12025550109 23 24 = Aditional info in your email = 25 26 You can also recover specific parts of the telephone number: the name of the country it refers to, the country code, the number without the country code. Use this tags: 27 28 1. [{your-phone}-cf7it-country-name]: It prints the name of the country. For the example above: United States 29 2. [{your-phone}-cf7it-country-code]: It prints the country code of the phone number. For the example above: 1 30 3. [{your-phone}-cf7it-national]: It prints the phone number without international prefix. For the example above: 2025550109 16 This plugin will use a jQuery plugin called International Telephone Input (http://jackocnr.com/intl-tel-input.html) to create a new type of input for Contact Form 7 that shows country flags to write a prefix of the telephone number. 31 17 32 18 == Installation == … … 48 34 == Changelog == 49 35 36 = 1.4.7 = 37 *We use upgrade JS version to 12.1.3. It fixes iPhone issues of old version 38 *We add mail tag that recovers iso code of the selected country 39 50 40 = 1.4.6 = 51 *We change to new CF7 functions naming (shortcode->form-tag) to avoid deprecated message with debug active (completed). No new features added41 We change to new CF7 functions naming (shortcode->form-tag) to avoid deprecated message with debug active (completed). No new features added 52 42 53 43 = 1.4.5 = 54 *We change to new CF7 functions naming (shortcode->form-tag) to avoid deprecated message with debug active (partial). No new features added44 We change to new CF7 functions naming (shortcode->form-tag) to avoid deprecated message with debug active (partial). No new features added 55 45 56 46 = 1.4.4 = 57 *We add the size attribute if it is sent as an option. For example: size:4047 We add the size attribute if it is sent as an option. For example: size:40 58 48 59 49 = 1.4.3 = 60 *We avoid the placeholder text to be copied into the value of the input field. This, sometimes caused the flags to desappear50 We avoid the placeholder text to be copied into the value of the input field. This, sometimes caused the flags to desappear 61 51 62 52 = 1.4.2 = 63 *We repare special mail tags53 We repare special mail tags 64 54 65 55 = 1.4.1 = 66 * We make it https compatible56 *We make it https compatible 67 57 68 58 = 1.4.0 = 69 * We add new mail tags in order to be able to recover the country name of a telephone, the contry code and the telephone number without the country code70 * In order to get the country name use [{your-phone}-cf7it-country-name] where {your-phone} has to be replaced by the name of your tag71 * In order to get the country code use [{your-phone}-cf7it-country-code] where {your-phone} has to be replaced by the name of your tag72 * In order to get the phone number without the country code use [{your-phone}-cf7it-national] where {your-phone} has to be replaced by the name of your tag59 *We add new mail tags in order to be able to recover the country name of a telephone, the contry code and the telephone number without the country code 60 *In order to get the country name use [{your-phone}-cf7it-country-name] where {your-phone} has to be replaced by the name of your tag 61 *In order to get the country code use [{your-phone}-cf7it-country-code] where {your-phone} has to be replaced by the name of your tag 62 *In order to get the phone number without the country code use [{your-phone}-cf7it-national] where {your-phone} has to be replaced by the name of your tag 73 63 74 64 = 1.3.0 = 75 * We force the dependecies between the JS files65 *We force the dependecies between the JS files 76 66 77 67 = 1.2.0 = 78 * We load the minified JS by default. If SCRIPT_DEBUG is set to true, we use the non-minified.68 *We load the minified JS by default. If SCRIPT_DEBUG is set to true, we use the non-minified. 79 69 80 70 = 1.1.0 = … … 88 78 == Upgrade Notice == 89 79 80 = 1.4.7 = 81 *We use upgrade JS version to 12.1.3. It fixes iPhone issues of old version 82 *We add mail tag that recovers iso code of the selected country 90 83 = 1.4.6 = 91 *We change to new CF7 functions naming (shortcode->form-tag) to avoid deprecated message with debug active. No new features added84 We change to new CF7 functions naming (shortcode->form-tag) to avoid deprecated message with debug active. No new features added 92 85 93 86 = 1.4.5 = 94 *We change to new CF7 functions naming (shortcode->form-tag) to avoid deprecated message with debug active. No new features added87 We change to new CF7 functions naming (shortcode->form-tag) to avoid deprecated message with debug active. No new features added 95 88 96 89 = 1.4.2 = 97 98 * We repare special mail tags 90 We repare special mail tags 99 91 100 92 = 1.4.1 = 101 102 * We make it https compatible 93 *We make it https compatible 103 94 104 95 = 1.4.0 = 105 * We add new mail tags in order to be able to recover the country name of a telephone, the contry code and the telephone number without the country code106 * In order to get the country name use [{your-phone}-cf7it-country-name] where {your-phone} has to be replaced by the name of your tag107 * In order to get the country code use [{your-phone}-cf7it-country-code] where {your-phone} has to be replaced by the name of your tag108 * In order to get the phone number without the country code use [{your-phone}-cf7it-national] where {your-phone} has to be replaced by the name of your tag96 *We add new mail tags in order to be able to recover the country name of a telephone, the contry code and the telephone number without the country code 97 *In order to get the country name use [{your-phone}-cf7it-country-name] where {your-phone} has to be replaced by the name of your tag 98 *In order to get the country code use [{your-phone}-cf7it-country-code] where {your-phone} has to be replaced by the name of your tag 99 *In order to get the phone number without the country code use [{your-phone}-cf7it-national] where {your-phone} has to be replaced by the name of your tag -
international-telephone-input-for-contact-form-7/trunk/script.js
r1530898 r1758139 19 19 jQuery(intl_tel_container).children('input.wpcf7-intl-tel-country-name').val(intl_tel_input.intlTelInput('getSelectedCountryData').name); 20 20 jQuery(intl_tel_container).children('input.wpcf7-intl-tel-country-code').val(intl_tel_input.intlTelInput('getSelectedCountryData').dialCode); 21 jQuery(intl_tel_container).children('input.wpcf7-intl-tel-country-iso2').val(intl_tel_input.intlTelInput('getSelectedCountryData').iso2); 21 22 }); 22 23 }); -
international-telephone-input-for-contact-form-7/trunk/script.min.js
r1530898 r1758139 1 jQuery(".wpcf7-intl-tel").intlTelInput({initialCountry:"auto",utilsScript:wpcf7_utils_url,geoIpLookup:function( a){jQuery.get("//ipinfo.io",function(){},"jsonp").always(function(b){var c=b&&b.country?b.country:"";a(c)})}}),jQuery(".wpcf7-intl-tel").each(function(){var a=jQuery(this),b=a.parents("span")[0],c=a.parents("form");c.submit(function(){jQuery(b).children("input.wpcf7-intl-tel-full").val(a.intlTelInput("getNumber")),jQuery(b).children("input.wpcf7-intl-tel-country-name").val(a.intlTelInput("getSelectedCountryData").name),jQuery(b).children("input.wpcf7-intl-tel-country-code").val(a.intlTelInput("getSelectedCountryData").dialCode)})});1 jQuery(".wpcf7-intl-tel").intlTelInput({initialCountry:"auto",utilsScript:wpcf7_utils_url,geoIpLookup:function(t){jQuery.get("//ipinfo.io",function(){},"jsonp").always(function(n){var e=n&&n.country?n.country:"";t(e)})}}),jQuery(".wpcf7-intl-tel").each(function(){var t=jQuery(this),n=t.parents("span")[0];t.parents("form").submit(function(){jQuery(n).children("input.wpcf7-intl-tel-full").val(t.intlTelInput("getNumber")),jQuery(n).children("input.wpcf7-intl-tel-country-name").val(t.intlTelInput("getSelectedCountryData").name),jQuery(n).children("input.wpcf7-intl-tel-country-code").val(t.intlTelInput("getSelectedCountryData").dialCode),jQuery(n).children("input.wpcf7-intl-tel-country-iso2").val(t.intlTelInput("getSelectedCountryData").iso2)})});
Note: See TracChangeset
for help on using the changeset viewer.