Last active
August 29, 2015 14:06
-
-
Save yamalight/8d0c6fefe7f63225f1fe to your computer and use it in GitHub Desktop.
Tooltip for Steam Recommended By Curators miniatures
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
// ==UserScript== | |
// @name Steam Recommended By Curators Tooltip | |
// @namespace http://steam.recommended.tooltips.enhancement/ | |
// @version 1.0 | |
// @description Adds quotes from non-main curators into the tooltip for them. | |
// @include http://store.steampowered.com/* | |
// @copyright 2013+, Tim Ermilov <[email protected]> | |
// ==/UserScript== | |
(function(){ | |
// override jquery for this scope | |
var $ = jQuery; | |
// get curator links | |
var els = $('.steam_curator_icon'); | |
els.each(function(index, item){ | |
if(item.classList.contains('small')) { | |
var originalText = item.getAttribute('data-store-tooltip'); | |
var link = $('a', item).attr('href'); | |
// fetch data from link | |
$.get(link, function(data) { | |
var text = originalText + '<br/><hr/>' + $('.highlighted_recommendation_desc', data).text(); | |
item.setAttribute('data-store-tooltip', text); | |
}); | |
} | |
}); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Example screenshot: http://i.imgur.com/L6B0HnR.png