Changeset 2728179
- Timestamp:
- 05/22/2022 10:38:06 PM (4 years ago)
- Location:
- translate-words/trunk
- Files:
-
- 4 edited
-
includes/administration.php (modified) (6 diffs)
-
js/main.js (modified) (1 diff)
-
readme.txt (modified) (1 diff)
-
translate-wp-words.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
translate-words/trunk/includes/administration.php
r2665051 r2728179 5 5 * @package tww 6 6 */ 7 8 /** 9 * A temporary variable since we don't seem to be able to use function calls in 10 * HEREDOC. 11 */ 12 $tww_translation_lines = esc_attr( TWW_TRANSLATIONS_LINES ); 13 14 /** 15 * Define a template pattern for reuse. 16 * This covers the new translation input fields and is used in both PHP and JS. 17 */ 18 define( 19 'TWW_NEW_STRING_TEMPLATE', 20 <<<TEMPLATE 21 <tr valign="top"> 22 <td style="white-space: nowrap"> 23 <input type="text" style="width:100%;" name="{$tww_translation_lines}[original][]" /> 24 → 25 </td> 26 <td><input type="text" style="width:100%;" name="{$tww_translation_lines}[overwrite][]" /></td> 27 <td></td> 28 </tr> 29 TEMPLATE 30 ); 31 7 32 8 33 /** … … 27 52 28 53 /** 29 * 54 * Enqueue Admin Scripts. 55 * 56 * @return void 30 57 */ 31 58 function tww_admin_enqueue_scripts() { … … 42 69 43 70 wp_enqueue_script( 44 'TWW_TRANSLATIONS_ JS',71 'TWW_TRANSLATIONS_ADMIN', 45 72 TWW_PLUGINS_DIR . 'js/main.js', 46 73 array( 'jquery' ), 47 '1.0. 0',74 '1.0.1', 48 75 false 76 ); 77 78 wp_localize_script( 79 'TWW_TRANSLATIONS_ADMIN', 80 'tww_properties', 81 array( 82 'template' => TWW_NEW_STRING_TEMPLATE, 83 ) 49 84 ); 50 85 … … 100 135 } 101 136 } 137 102 138 } 103 139 … … 173 209 } 174 210 } 175 ?> 176 <tr valign="top"> 177 <td style="white-space: nowrap"> 178 <input type="text" style="width:100%;" name="<?php echo esc_attr( TWW_TRANSLATIONS_LINES ); ?>[original][]" /> 179 → 180 </td> 181 <td> 182 <input type="text" style="width:100%;" name="<?php echo esc_attr( TWW_TRANSLATIONS_LINES ); ?>[overwrite][]" /> 183 </td> 184 <td></td> 185 </tr> 211 212 echo TWW_NEW_STRING_TEMPLATE; 213 214 ?> 215 186 216 </tbody> 187 217 </table> … … 194 224 </form> 195 225 </div> 226 196 227 <?php 197 228 -
translate-words/trunk/js/main.js
r2523953 r2728179 23 23 e.preventDefault(); 24 24 25 var row = ''; 26 27 row += '<tr valign="top">'; 28 row += '<td style="white-space: nowrap;">';