Changeset 13066
- Timestamp:
- 12/18/2023 11:41:17 AM (12 months ago)
- Location:
- sites/trunk/wordpress.org/public_html/wp-content/plugins/gp-translation-helpers
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/gp-translation-helpers/css/discussion.css
r12656 r13066 339 339 font-size: 1em; 340 340 } 341 342 @keyframes loading-indicator { 343 0%, 80%, 100% { 344 opacity: 0; 345 } 346 40% { 347 opacity: 1; 348 } 349 } 350 351 .suggestions__loading-indicator__icon { 352 font-size: 4px; 353 margin-left: .5rem; 354 line-height: 1; 355 display: inline-block; 356 vertical-align: middle; 357 } 358 359 .suggestions__loading-indicator__icon span { 360 animation-duration: 1s; 361 animation-delay: 0ms; 362 animation-iteration-count: infinite; 363 animation-name: loading-indicator; 364 animation-timing-function: ease-in-out; 365 background-color: #666; 366 border-radius: 50%; 367 display: inline-block; 368 width: 1em; 369 vertical-align: top; 370 height: 1em; 371 } 372 373 .suggestions__loading-indicator__icon span:nth-child(2) { 374 animation-delay: 160ms; 375 margin-left: 1em; 376 } 377 378 .suggestions__loading-indicator__icon span:nth-child(3) { 379 animation-delay: 320ms; 380 margin-left: 1em; 381 } -
sites/trunk/wordpress.org/public_html/wp-content/plugins/gp-translation-helpers/css/editor.css
r12405 r13066 6 6 } 7 7 8 .meta.discussion, .meta. history, .meta.other-locales {8 .meta.discussion, .meta.others { 9 9 padding: 1rem; 10 10 } 11 11 12 .meta.discussion h6 { 12 13 margin-block: auto; 13 14 } 14 15 15 .meta.history .translations { 16 .meta.others .details-history, 17 .meta.others .details-other-locales { 18 margin: 1rem 0 -0.5rem 0; 19 } 20 21 .meta.others .summary-history, 22 .meta.others .summary-other-locales { 23 font-weight: bold; 24 margin-bottom: 0.5rem; 25 } 26 27 .meta.others .sidebar-div-others-history-content { 28 margin-left: 0.5rem; 29 } 30 31 .meta.others .translations { 16 32 width: 100%; 17 33 } 18 .meta.history #translation-history-table thead tr th { 34 35 .meta.others #translation-history-table thead tr th { 19 36 font-size: 0.9rem; 20 37 font-weight: 500 !important; 21 38 } 22 39 23 .meta. history#legend > div {40 .meta.others #legend > div { 24 41 margin-top: 0.5rem; 25 42 } 26 43 27 .meta.other -locales ul {44 .meta.others ul { 28 45 list-style: none; 29 46 } 30 47 31 .meta.other -locales span.locale.unique {32 margin-right: 26px;48 .meta.others span.locale.unique { 49 margin-right: 0.5rem; 33 50 } 34 51 35 .meta.other -locales .other-locales .locale {52 .meta.others .other-locales .locale { 36 53 display: inline-block; 37 54 padding: 1px 6px 0 0; … … 44 61 } 45 62 46 .meta.other-locales .sidebar-other-locales { 63 .sidebar-div-others-other-locales-content > ul { 64 padding-left: 1rem; 65 } 66 67 .meta.others .sidebar-other-locales { 47 68 margin: 0.1rem .5rem; 48 69 } -
sites/trunk/wordpress.org/public_html/wp-content/plugins/gp-translation-helpers/js/editor.js
r12713 r13066 1 /* global document, $gp, $gp_translation_helpers_editor, wpApiSettings, $gp_comment_feedback_settings, $gp_editor_options, fetch, TextDecoderStream, URL, URLSearchParams, window */1 /* global document, $gp, $gp_translation_helpers_editor, wpApiSettings, $gp_comment_feedback_settings, $gp_editor_options, fetch, TextDecoderStream, URL, URLSearchParams, window, translationHelpersCache, add_amount_to_others_tab */ 2 2 /* eslint camelcase: "off" */ 3 3 jQuery( function( $ ) { … … 5 5 * Stores (caches) the content of the translation helpers, to avoid making the query another time. 6 6 * 7 * @type { Array}7 * @type {Object} 8 8 */ 9 9 // eslint-disable-next-line prefer-const 10 let translationHelpersCache = []; 10 window.translationHelpersCache = {}; 11 11 12 let focusedRowId = ''; 12 13 // When a user clicks on a sidebar tab, the visible tab and div changes. … … 233 234 $( '#sidebar-div-meta-' + originalId ).hide(); 234 235 $( '#sidebar-div-discussion-' + originalId ).hide(); 235 $( '#sidebar-div-history-' + originalId ).hide(); 236 $( '#sidebar-div-other-locales-' + originalId ).hide(); 236 $( '#sidebar-div-others-' + originalId ).hide(); 237 237 $( '#' + tabId ).show(); 238 238 } … … 250 250 $( this ).html( html ); 251 251 } ); 252 } 253 254 /** 255 * Adds the amount of elements to the "Others" tab. 256 * 257 * @param {string} sidebarTab The tab where we add the amount of elements. 258 * @param {Object} data The object where we have the data to add. 259 * @param {number} originalId The id of the original string to translate. 260 */ 261 if ( typeof window.add_amount_to_others_tab === 'undefined' ) { 262 add_amount_to_others_tab = function( sidebarTab, data, originalId ) { 263 let elements = 0; 264 if ( data[ 'helper-history-' + originalId ] !== undefined ) { 265 elements += data[ 'helper-history-' + originalId ].count; 266 } 267 if ( data[ 'helper-other-locales-' + originalId ] !== undefined ) { 268 elements += data[ 'helper-other-locales-' + originalId ].count; 269 } 270 $( '[data-tab="' + sidebarTab + '"]' ).html( 'Others (' + elements + ')' ); 271 }; 252 272 } 253 273 … … 284 304 } 285 305 if ( data[ 'helper-history-' + originalId ] !== undefined ) { 286 $( '[data-tab="sidebar-tab-history-' + originalId + '"]' ).html( 'History (' + data[ 'helper-history-' + originalId ].count + ')' ); 287 $( '#sidebar-div-history-' + originalId ).html( data[ 'helper-history-' + originalId ].content ); 306 $( '#summary-history-' + originalId ).html( 'History (' + data[ 'helper-history-' + originalId ].count + ')' ); 307 $( '#sidebar-div-others-history-content-' + originalId ).html( data[ 'helper-history-' + originalId ].content ); 308 add_amount_to_others_tab( 'sidebar-tab-others-' + originalId, data, originalId ); 309 } else { 310 $( '#sidebar-div-others-history-content-' + originalId ).html( '' ); 288 311 } 289 312 if ( data[ 'helper-other-locales-' + originalId ] !== undefined ) { 290 $( '[data-tab="sidebar-tab-other-locales-' + originalId + '"]' ).html( 'Other locales (' + data[ 'helper-other-locales-' + originalId ].count + ')' ); 291 $( '#sidebar-div-other-locales-' + originalId ).html( data[ 'helper-other-locales-' + originalId ].content ); 292 add_copy_button( '#sidebar-div-other-locales-' + originalId ); 313 $( '#summary-other-locales-' + originalId ).html( 'Other locales (' + data[ 'helper-other-locales-' + originalId ].count + ')' ); 314 $( '#sidebar-div-others-other-locales-content-' + originalId ).html( data[ 'helper-other-locales-' + originalId ].content ); 315 add_copy_button( '#sidebar-div-others-other-locales-content-' + originalId ); 316 add_amount_to_others_tab( 'sidebar-tab-others-' + originalId, data, originalId ); 317 } else { 318 $( '#sidebar-div-others-other-locales-content-' + originalId ).html( '' ); 293 319 } 294 320 } -
sites/trunk/wordpress.org/public_html/wp-content/plugins/gp-translation-helpers/templates/gp-templates-overrides/translation-row-editor-meta.php
r12405 r13066 172 172 $sidebar_tabs .= ' <li class="current tab-meta" data-tab="sidebar-tab-meta-' . $translation->row_id . '" data-row-id="' . $translation->row_id . '">Meta</li>'; 173 173 $sidebar_tabs .= ' <li class="tab-discussion" data-tab="sidebar-tab-discussion-' . $translation->row_id . '" data-row-id="' . $translation->row_id . '">Discussion <span class="count"></span></li>'; 174 $sidebar_tabs .= ' <li class="tab-history" data-tab="sidebar-tab-history-' . $translation->row_id . '" data-row-id="' . $translation->row_id . '">History <span class="count"></span></li>'; 175 $sidebar_tabs .= ' <li class="tab-other-locales" data-tab="sidebar-tab-other-locales-' . $translation->row_id . '" data-row-id="' . $translation->row_id . '">Other locales <span class="count"></span></li>'; 174 $sidebar_tabs .= ' <li class="tab-others" data-tab="sidebar-tab-others-' . $translation->row_id . '" data-row-id="' . $translation->row_id . '">Others <span class="count"></span></li>'; 176 175 $sidebar_tabs .= '</ul>'; 177 176 $sidebar_tabs .= $meta_sidebar; 178 177 $sidebar_tabs .= '<div class="meta discussion" id="sidebar-div-discussion-' . $translation->row_id . '" data-row-id="' . $translation->row_id . '" style="display: none;"></div>'; 179 $sidebar_tabs .= '<div class="meta history" id="sidebar-div-history-' . $translation->row_id . '" data-row-id="' . $translation->row_id . '" style="display: none;"></div>'; 180 $sidebar_tabs .= '<div class="meta other-locales" id="sidebar-div-other-locales-' . $translation->row_id . '" data-row-id="' . $translation->row_id . '" style="display: none;"></div>'; 178 $sidebar_tabs .= '<div class="meta others" id="sidebar-div-others-' . $translation->row_id . '" data-row-id="' . $translation->row_id . '" style="display: none;">'; 179 $sidebar_tabs .= ' <details class="details-other-locales" open="">'; 180 $sidebar_tabs .= ' <summary class="summary-other-locales" id="summary-other-locales-' . $translation->row_id . '">Other locales'; 181 $sidebar_tabs .= ' <span aria-hidden="true" class="suggestions__loading-indicator__icon"><span></span><span></span><span></span></span>'; 182 $sidebar_tabs .= ' </summary>'; 183 $sidebar_tabs .= ' <div class="sidebar-div-others-other-locales-content" id="sidebar-div-others-other-locales-content-' . $translation->row_id . '"></div>'; 184 $sidebar_tabs .= ' </details>'; 185 $sidebar_tabs .= ' <details class="details-history" open="">'; 186 $sidebar_tabs .= ' <summary class="summary-history" id="summary-history-' . $translation->row_id . '">History'; 187 $sidebar_tabs .= ' <span aria-hidden="true" class="suggestions__loading-indicator__icon"><span></span><span></span><span></span></span>'; 188 $sidebar_tabs .= ' </summary>'; 189 $sidebar_tabs .= ' <div class="sidebar-div-others-history-content" id="sidebar-div-others-history-content-' . $translation->row_id . '"></div>'; 190 $sidebar_tabs .= ' </details>'; 191 $sidebar_tabs .= '</div>'; /* meta others */ 181 192 $sidebar_tabs .= '</nav>'; 182 193
Note: See TracChangeset
for help on using the changeset viewer.