Changeset 1995375
- Timestamp:
- 12/15/2018 10:46:25 AM (7 years ago)
- Location:
- cf7-phone-mask-field/trunk
- Files:
-
- 4 added
- 2 edited
-
assets/js/jquery.admin.main.js (added)
-
assets/languages (added)
-
assets/languages/cf7-mask-field-ru_RU.mo (added)
-
assets/languages/cf7-mask-field-ru_RU.po (added)
-
cf7-phone-mask-field.php (modified) (10 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
cf7-phone-mask-field/trunk/cf7-phone-mask-field.php
r1988214 r1995375 3 3 Plugin Name: Contact Form 7 - Phone mask field 4 4 Description: This plugin adds a new field in which you can set the phone number entry mask or other to Contact Form 7. 5 Version: 1. 15 Version: 1.3 6 6 Author: Ruslan Heorhiiev 7 Text Domain: cf7- phone-mask-field7 Text Domain: cf7-mask-field 8 8 Domain Path: /assets/languages/ 9 9 … … 13 13 if ( ! ABSPATH ) exit; 14 14 15 define( 'CF7MF_TEXT_DOMAIN', 'cf7-mask-field' ); 16 15 17 /** 16 18 * Функция инициализации плагина … … 19 21 function wpcf7mf_init(){ 20 22 add_action( 'wpcf7_init', 'wpcf7mf_add_shortcode_mask' ); 21 add_action( 'wp_enqueue_scripts', 'wpcf7mf_do_enqueue_scripts' ); 22 add_filter( 'wpcf7_validate_mask*', 'wpcf7mf_mask_validation_filter', 10, 2 ); 23 24 // загрузка language файла & load language file. 25 load_plugin_textdomain( 'contact-form-7-mask-field', false, dirname( plugin_dir_path( __FILE__ ) ) . '/assets/languages/' ); 23 add_action( 'wp_enqueue_scripts', 'wpcf7mf_enqueue_scripts' ); 24 add_action( 'admin_enqueue_scripts', 'wpcf7mf_admin_enqueue_scripts' ); 25 add_filter( 'wpcf7_validate_mask*', 'wpcf7mf_mask_validation_filter', 10, 2 ); 26 26 } 27 27 add_action( 'plugins_loaded', 'wpcf7mf_init' , 20 ); … … 32 32 * @version 1.0 33 33 **/ 34 function wpcf7mf_ do_enqueue_scripts() {34 function wpcf7mf_enqueue_scripts() { 35 35 wp_enqueue_script( 'wpcf7mf-mask', plugin_dir_url( __FILE__ ) . 'assets/js/jquery.maskedinput.min.js', array('jquery'), '1.4', true ); 36 36 } 37 add_action( 'wp_enqueue_scripts', 'wpcf7mf_do_enqueue_scripts' ); 37 38 /** 39 * Функция подключения JS для админки 40 * Function enqueu script for admin panel 41 * @version 1.0 42 **/ 43 function wpcf7mf_admin_enqueue_scripts( $hook_suffix ) { 44 if ( false === strpos( $hook_suffix, 'wpcf7' ) ) { 45 return; 46 } 47 48 wp_enqueue_script( 'wpcf7mf-admin', plugin_dir_url( __FILE__ ) . 'assets/js/jquery.admin.main.js?v=' . rand(), array('jquery'), null, false ); 49 } 38 50 39 51 /** … … 70 82 if ( $validation_error ) { 71 83 $class .= ' wpcf7-not-valid'; 72 } 84 } 73 85 74 86 $atts = array(); … … 95 107 96 108 $atts['aria-invalid'] = $validation_error ? 'true' : 'false'; 109 97 110 98 111 foreach ( $tag->values as $val ) { … … 181 194 $tag_generator->add( 182 195 'mask', 183 __( 'mask field', 'contact-form-7-mask-field'),196 __( 'mask field', CF7MF_TEXT_DOMAIN ), 184 197 'wpcf7mf_tag_generator_field' 185 198 ); … … 200 213 <fieldset> 201 214 202 <legend><?php echo esc_html( __( 'Generate a form-tag for a single-line plain text input field in which you can set the input mask.', 'contact-form-7-mask-field' ) ); ?></legend> 215 <legend> 216 <?php 217 _e( 'Generate a form-tag for a single-line plain text input field in which you can set the input mask.', CF7MF_TEXT_DOMAIN ); 218 ?> 219 </legend> 203 220 204 221 <table class="form-table"> 205 222 <tbody> 206 223 <tr> 207 <th scope="row"><?php echo esc_html( __( 'Field type', 'contact-form-7' )); ?></th>224 <th scope="row"><?php _e( 'Field type', 'contact-form-7' ); ?></th> 208 225 <td> 209 226 <fieldset> 210 <legend class="screen-reader-text"><?php echo esc_html( __( 'Field type', 'contact-form-7' )); ?></legend>211 <label><input type="checkbox" name="required" /> <?php echo esc_html( __( 'Required field', 'contact-form-7' )); ?></label>227 <legend class="screen-reader-text"><?php _e( 'Field type', 'contact-form-7' ); ?></legend> 228 <label><input type="checkbox" name="required" /> <?php _e( 'Required field', 'contact-form-7' ); ?></label> 212 229 </fieldset> 213 230 </td> … … 215 232 216 233 <tr> 217 <th scope="row"><label for="<?php echo esc_attr( $args['content'] . '-name' ); ?>"><?php echo esc_html( __( 'Name', 'contact-form-7' )); ?></label></th>234 <th scope="row"><label for="<?php echo esc_attr( $args['content'] . '-name' ); ?>"><?php _e( 'Name', 'contact-form-7' ); ?></label></th> 218 235 <td><input type="text" name="name" class="tg-name oneline" id="<?php echo esc_attr( $args['content'] . '-name' ); ?>" /></td> 219 236 </tr> … … 221 238 <!-- msk field --> 222 239 <tr> 223 <th scope="row"><label for="<?php echo esc_attr( $args['content'] . '-values' ); ?>"><?php echo esc_html( __( 'Mask', 'contact-form-7-mask-field' )); ?></label></th>240 <th scope="row"><label for="<?php echo esc_attr( $args['content'] . '-values' ); ?>"><?php _e( 'Mask', CF7MF_TEXT_DOMAIN ); ?></label></th> 224 241 <td><input type="text" name="values" class="maskvalue oneline" id="<?php echo esc_attr( $args['content'] . '-values' ); ?>" /><br /> 225 <?php _e( 'Enter the mask for this field. <br /><code>Example: +_ (___) ___-__-__</code>', 'contact-form-7-mask-field'); ?></td>242 <?php _e( 'Enter the mask for this field. <br /><code>Example: +_ (___) ___-__-__</code>', CF7MF_TEXT_DOMAIN ); ?></td> 226 243 </tr> 227 244 228 <tr> 229 <th scope="row"><label for="<?php echo esc_attr( $args['content'] . '-id' ); ?>"><?php echo esc_html( __( 'Id attribute', 'contact-form-7' ) ); ?></label></th> 245 <!-- placeholder field --> 246 <tr> 247 <th scope="row"><label for="<?php echo esc_attr( $args['content'] . '-placeholder' ); ?>"><?php _e( 'Placeholder', CF7MF_TEXT_DOMAIN ); ?></label></th> 248 <td><input type="text" name="values" class="placeholdervalue oneline" id="<?php echo esc_attr( $args['content'] . '-placeholder' ); ?>" /><br /> 249 </tr> 250 251 <tr> 252 <th scope="row"><label for="<?php echo esc_attr( $args['content'] . '-id' ); ?>"><?php _e( 'Id attribute', 'contact-form-7' ); ?></label></th> 230 253 <td><input type="text" name="id" class="idvalue oneline option" id="<?php echo esc_attr( $args['content'] . '-id' ); ?>" /></td> 231 254 </tr> 232 255 233 256 <tr> 234 <th scope="row"><label for="<?php echo esc_attr( $args['content'] . '-class' ); ?>"><?php echo esc_html( __( 'Class attribute', 'contact-form-7' )); ?></label></th>257 <th scope="row"><label for="<?php echo esc_attr( $args['content'] . '-class' ); ?>"><?php _e( 'Class attribute', 'contact-form-7' ); ?></label></th> 235 258 <td><input type="text" name="class" class="classvalue oneline option" id="<?php echo esc_attr( $args['content'] . '-class' ); ?>" /></td> 236 259 </tr> -
cf7-phone-mask-field/trunk/readme.txt
r1988214 r1995375 4 4 Requires at least: 4.0 5 5 Tested up to: 5.0 6 Stable tag: 1. 16 Stable tag: 1.3 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 42 42 = 1.1 = 43 43 * Added support for the placeholder field. 44 45 = 1.2 = 46 * Tested up to 5.0 47 48 = 1.3 = 49 * Added a placeholder field for the mask tag form genarator
Note: See TracChangeset
for help on using the changeset viewer.