Last active
August 29, 2015 14:24
-
-
Save lingo/11476ce245cb05aec543 to your computer and use it in GitHub Desktop.
Enable hover styles to display source template (requires patch to SSViewer)
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 works with the patch here: | |
* https://gist.github.com/lingo/5fd432cfb70758907f85 | |
*/ | |
var style = document.createElement('style'); | |
style.textContent = | |
'.sstemplate: hover {' + | |
' border: 2px solid red;' + | |
' position: relative;' + | |
'}' + | |
'.sstemplate: hover: after {' + | |
' content: attr(data - cachefile);' + | |
' display: block;' + | |
' position: absolute;' + | |
' top: 0;' + | |
' right: 0;' + | |
' background: rgba(255, 255, 255, 0.5);' + | |
' color: red;' + | |
' padding: 0.5em;' + | |
'}'; | |
document.head.appendChild(style); | |
$('[data-cachefile]').addClass('sstemplate'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment