hints.js 625 B

1234567891011121314151617181920
  1. (function () {
  2. // mouseover tooltips for various UI elements
  3. const titles = {
  4. '🔄': 'Refresh',
  5. '\u2934': 'Send dimensions to stable diffusion',
  6. '💥': 'Run preprocessor',
  7. '📝': 'Open new canvas',
  8. '📷': 'Enable webcam',
  9. '⇄': 'Mirror webcam',
  10. };
  11. onUiUpdate(function () {
  12. gradioApp().querySelectorAll('.cnet-toolbutton').forEach(function (button) {
  13. const tooltip = titles[button.textContent];
  14. if (tooltip && (!button.hasAttribute("title"))) {
  15. button.title = tooltip;
  16. }
  17. })
  18. });
  19. })();