1(function ($) { 2 $(document).ready(() => { 3 const root = getDocumentRoot(); 4 const body = getDocumentBody(); 5 body.attr('show-outline', outlineUserOptions.show_outline); 6 body.attr('show-block-name', outlineUserOptions.show_block_name); 7 body.attr('show-class-name', outlineUserOptions.show_class_name); 8 body.attr('lock-block-outline', outlineUserOptions.lock_block_outline); 9 body.attr('block-data-position', outlineUserOptions.block_data_position); 10 body.attr('enable-outline-padding', outlineUserOptions.enable_outline_padding); 11 12 // Update outline color 13 const c = jQuery.Color(outlineUserOptions.outline_color); 14 c.toHslaString(); 15 16 // Form HSLA color 17 const saturation = Math.round(c._hsla[1] * 100); 18 const lightness = Math.round(c._hsla[2] * 100); 19 20 const hsla = `hsla(${c._hsla[0]}deg, ${saturation}%, ${lightness}%, var(--outline-opacity))`; 21 root.style.setProperty('--outline-color', hsla); 22 23 // update text color 24 const colorLightness = c.lightness(); 25 let color = '#000000'; 26 if (colorLightness < 0.5) { 27 color = '#ffffff'; 28 } 29 root.style.setProperty('--outline-text-color', color); 30 31 // Set line style 32 root.style.setProperty('--outline-style', outlineUserOptions.outline_style); 33 34 // Set outline opacity 35 const opacity = outlineUserOptions.outline_opacity / 100; 36 root.style.setProperty('--outline-opacity', opacity); 37 38 // Set outline padding 39 const padding = outlineUserOptions.outline_padding; 40 root.style.setProperty('--outline-padding', `${padding}px`); 41 }); 42})(jQuery);
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.