Skip to content

Instantly share code, notes, and snippets.

@markstinson
Forked from mikemanger/indieroyale.user.js
Last active December 6, 2016 03:14
Show Gist options
  • Save markstinson/1606fa532246cb6d231d4719db03cebc to your computer and use it in GitHub Desktop.
Save markstinson/1606fa532246cb6d231d4719db03cebc to your computer and use it in GitHub Desktop.
Indie Royal Collection Labeler
// ==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