1(function (Drupal) { 2 'use strict'; 3 4 const votingInputLabels = { 5 'goog-gt-votingInputSrcLang': 'Source language code', 6 'goog-gt-votingInputTrgLang': 'Target language code', 7 'goog-gt-votingInputSrcText': 'Source text', 8 'goog-gt-votingInputTrgText': 'Translated text', 9 'goog-gt-votingInputVote': 'Translation vote', 10 }; 11 12 function patchVotingPaneAttributes() { 13 const pane = document.getElementById('goog-gt-votingHiddenPane'); 14 if (!pane) { 15 return; 16 } 17 18 pane.setAttribute('aria-hidden', 'true'); 19 20 const form = pane.querySelector('#goog-gt-votingForm'); 21 if (form) { 22 form.setAttribute('aria-hidden', 'true'); 23 } 24 25 Object.entries(votingInputLabels).forEach(([id, label]) => { 26 const input = pane.querySelector(`#${id}`); 27 if (!input) { 28 return; 29 } 30 input.setAttribute('tabindex', '-1'); 31 }); 32 } 33 34 Drupal.behaviors.chaGoogleTranslateA11y = { 35 attach() { 36 patchVotingPaneAttributes(); 37 38 if (window.chaGoogleTranslateA11yObserver) { 39 return; 40 } 41 42 window.chaGoogleTranslateA11yObserver = new MutationObserver(() => { 43 patchVotingPaneAttributes(); 44 }); 45 46 window.chaGoogleTranslateA11yObserver.observe(document.body, { 47 childList: true, 48 subtree: true, 49 }); 50 }, 51 }; 52})(Drupal);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.