-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from GeorgLegato/5-check-photosphereviewer-in-…
…gradiogallery fixes #5
- Loading branch information
Showing
7 changed files
with
959 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// mouseover tooltips for various UI elements | ||
|
||
pano_titles = { | ||
"Pano 👀":"Send to Panorama Viewer Tab", | ||
"Pano 🌐": "Switch between selected image and panorama view" | ||
} | ||
|
||
|
||
onUiUpdate(function(){ | ||
gradioApp().querySelectorAll('span, button, select, p').forEach(function(span){ | ||
tooltip = pano_titles[span.textContent]; | ||
|
||
if(!tooltip){ | ||
tooltip = pano_titles[span.value]; | ||
} | ||
|
||
if(!tooltip){ | ||
for (const c of span.classList) { | ||
if (c in pano_titles) { | ||
tooltip = pano_titles[c]; | ||
break; | ||
} | ||
} | ||
} | ||
|
||
if(tooltip){ | ||
span.title = tooltip; | ||
} | ||
}) | ||
|
||
gradioApp().querySelectorAll('select').forEach(function(select){ | ||
if (select.onchange != null) return; | ||
|
||
select.onchange = function(){ | ||
select.title = pano_titles[select.value] || ""; | ||
} | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.