Plugin Directory

Changeset 1758139


Ignore:
Timestamp:
11/03/2017 05:18:04 PM (8 years ago)
Author:
damiarita
Message:

V 1.5 We move to v.12 of JS library and add new mail tag

Location:
international-telephone-input-for-contact-form-7/trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • international-telephone-input-for-contact-form-7/trunk/form-tag.php

    r1572579 r1758139  
    6868    $atts_country_code['name'] = $tag->name . '-cf7it-country-code';
    6969    $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';
    7075
    7176    $atts = wpcf7_format_atts( $atts );
     
    7378    $atts_country = wpcf7_format_atts( $atts_country );
    7479    $atts_country_code = wpcf7_format_atts( $atts_country_code );
     80    $atts_country_iso= wpcf7_format_atts( $atts_country_iso);
    7581
    7682    $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 );
    7985
    8086    return $html;
     
    8793    }
    8894 
    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');
    9197    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' );
    9399}
    94100
  • international-telephone-input-for-contact-form-7/trunk/functions.php

    r1572582 r1758139  
    33 * Plugin Name: International Telephone Input for Contact Form 7
    44 * 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 code
    6  * Version: 1.4.6
     5 * 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
    77 * Author: Damià Rita
    88 * Author URI: https://www.facebook.com/damiarita
  • international-telephone-input-for-contact-form-7/trunk/mail-tags.php

    r1535510 r1758139  
    66    if ( wpcf7_intl_tel_ends_with($name, '-cf7it-national') ):
    77        return wpcf7_intl_tel_recover_field( $name );
    8     endif;
     8        endif;
    99    if ( wpcf7_intl_tel_ends_with($name, '-cf7it-country-code') ):
    1010        return wpcf7_intl_tel_recover_field( $name );
    11     endif;
     11        endif;
    1212    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') ):
    1316        return wpcf7_intl_tel_recover_field( $name );
    1417    endif;
  • international-telephone-input-for-contact-form-7/trunk/readme.txt

    r1599008 r1758139  
    33Tags: css, javascript, jQuery, contact form 7, international, i18n, international code, country code, telephone
    44Stable tag: trunk
    5 Requires at least: 1.4.3
    6 Tested up to: 4.7
     5Requires at least: 1.5.0
     6Tested up to: 4.8.3
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    1414Addon 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
    1515
    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
     16This 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.
    3117
    3218== Installation ==
     
    4834== Changelog ==
    4935
     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
    5040= 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 added
     41We change to new CF7 functions naming (shortcode->form-tag) to avoid deprecated message with debug active (completed). No new features added
    5242
    5343= 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 added
     44We change to new CF7 functions naming (shortcode->form-tag) to avoid deprecated message with debug active (partial). No new features added
    5545
    5646= 1.4.4 =
    57 * We add the size attribute if it is sent as an option. For example: size:40
     47We add the size attribute if it is sent as an option. For example: size:40
    5848
    5949= 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 desappear
     50We avoid the placeholder text to be copied into the value of the input field. This, sometimes caused the flags to desappear
    6151
    6252= 1.4.2 =
    63 * We repare special mail tags
     53We repare special mail tags
    6454
    6555= 1.4.1 =
    66 * We make it https compatible
     56*We make it https compatible
    6757
    6858= 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 code
    70 * 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
    71 * 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
    72 * 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
     59*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
    7363
    7464= 1.3.0 =
    75 * We force the dependecies between the JS files
     65*We force the dependecies between the JS files
    7666
    7767= 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.
    7969
    8070= 1.1.0 =
     
    8878== Upgrade Notice ==
    8979
     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
    9083= 1.4.6 =
    91 * We change to new CF7 functions naming (shortcode->form-tag) to avoid deprecated message with debug active. No new features added
     84We change to new CF7 functions naming (shortcode->form-tag) to avoid deprecated message with debug active. No new features added
    9285
    9386= 1.4.5 =
    94 * We change to new CF7 functions naming (shortcode->form-tag) to avoid deprecated message with debug active. No new features added
     87We change to new CF7 functions naming (shortcode->form-tag) to avoid deprecated message with debug active. No new features added
    9588
    9689= 1.4.2 =
    97 
    98 * We repare special mail tags
     90We repare special mail tags
    9991
    10092= 1.4.1 =
    101 
    102 * We make it https compatible
     93*We make it https compatible
    10394
    10495= 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 code
    106 * 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
    107 * 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
    108 * 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
     96*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  
    1919        jQuery(intl_tel_container).children('input.wpcf7-intl-tel-country-name').val(intl_tel_input.intlTelInput('getSelectedCountryData').name);
    2020        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);
    2122    });
    2223});
  • 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)})});
     1jQuery(".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.