-
-
Save markstinson/1606fa532246cb6d231d4719db03cebc to your computer and use it in GitHub Desktop.
Indie Royal Collection Labeler
This file contains hidden or 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
// ==UserScript== | |
// @name Indie Royale Bundle Labeler | |
// @include http://www.indieroyale.com/collection | |
// @updateURL https://gist.githubusercontent.com/markstinson/1606fa532246cb6d231d4719db03cebc/raw | |
// @downloadURL https://gist.githubusercontent.com/markstinson/1606fa532246cb6d231d4719db03cebc/raw | |
// @grant none | |
// @version 1.3.1 | |
// ==/UserScript== | |
// update with your username/checksum | |
function irbl_add_global_styles() { | |
var head, style; | |
head = document.getElementsByTagName( 'head' )[0]; | |
if ( ! head ) { | |
return; | |
} | |
style = document.createElement( 'style' ); | |
style.type = 'text/css'; | |
style.innerHTML = '.hasbundle h3 { background-color: rgba(0,0,0,0.7); color: white; padding: 0 5px; position: absolute; left: 0; right: 0; }'; | |
head.appendChild( style ); | |
} | |
irbl_add_global_styles(); | |
var bundles = document.getElementsByClassName('hasbundle'), header, title, i; | |
for ( i = 0; i < bundles.length; i++ ) { | |
title = bundles[i].getAttribute('title'); | |
header = document.createElement('h3'); | |
header.innerHTML = title; | |
bundles[i].insertBefore(header, bundles[i].firstChild); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment