|
36 | 36 |
|
37 | 37 | $source_string = Utils::secureText($tmx_source[$entity]);
|
38 | 38 |
|
| 39 | + $clipboard_target_string = 'clip_' . md5($target_string); |
| 40 | + |
| 41 | + // Don't show meta links by default |
| 42 | + $meta_source = $meta_target = $meta_target2 = ''; |
| 43 | + |
39 | 44 | // 3locales view
|
40 | 45 | if ($url['path'] == '3locales') {
|
41 | 46 | $bz_target_string2 = $target_string2 = isset($tmx_target2[$entity])
|
|
44 | 49 | // Highlight non-breaking spaces only after strings have been escaped
|
45 | 50 | $target_string2 = str_replace(' ', '<span class="highlight-gray"> </span>', $target_string2);
|
46 | 51 |
|
| 52 | + $clipboard_target_string2 = 'clip_' . md5($target_string2); |
| 53 | + |
47 | 54 | if (in_array($current_repo, ['firefox_ios', 'mozilla_org'])) {
|
48 | 55 | $path_locale3 = VersionControl::gitPath($locale2, $current_repo, $entity);
|
49 | 56 | } else {
|
|
67 | 74 | $target_string2 = '<em class="error">Warning: Missing string</em>';
|
68 | 75 | } elseif (! $target_string2) {
|
69 | 76 | $target_string2 = '<em class="error">Warning: Empty string</em>';
|
| 77 | + } else { |
| 78 | + $meta_target2 = "<span class='clipboard' data-clipboard-target='#{$clipboard_target_string2}' alt='Copy to clipboard'><img src='/img/copy_icon_black_18x18.png'></span>"; |
70 | 79 | }
|
71 | 80 |
|
72 | 81 | $extra_column_rows = "
|
73 | 82 | <td dir='{$direction3}'>
|
74 | 83 | <span class='celltitle'>{$locale2}</span>
|
75 |
| - <div class='string'>{$target_string2}</div> |
| 84 | + <div class='string' id='{$clipboard_target_string2}'>{$target_string2}</div> |
76 | 85 | <div dir='ltr' class='result_meta_link'>
|
77 | 86 | <a class='source_link' href='{$path_locale3}'><source></a>
|
78 | 87 | {$file_bug}
|
| 88 | + {$meta_target2} |
79 | 89 | </div>
|
80 | 90 | </td>";
|
81 | 91 | } else {
|
|
102 | 112 | . '"><report a bug></a>';
|
103 | 113 | $anchor_name = str_replace(['/', ':'], '_', $entity);
|
104 | 114 |
|
105 |
| - $clipboard_target_string = 'clip_' . md5($target_string); |
106 |
| - |
107 | 115 | // Get the potential errors for $target_string (final dot, long/small string)
|
108 | 116 | $error_message = ShowResults::buildErrorString($source_string, $target_string);
|
109 | 117 |
|
110 |
| - // Don't show meta links by default |
111 |
| - $meta_source = $meta_target = ''; |
112 |
| - |
113 | 118 | // If there is no source_string, display an error, otherwise display the string + meta links
|
114 | 119 | if (! $source_string) {
|
115 | 120 | $source_string = '<em class="error">Warning: Source string is empty</em>';
|
|
0 commit comments