Last active
March 7, 2018 15:22
-
-
Save csmatt/16c9d265f38241ebf1c1d9d5d97eada3 to your computer and use it in GitHub Desktop.
Greasemonkey/Tampermonkey script that fixes some annoying things about Thingiverse
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 Thingiverse Part Name Display Fixes | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description Fixes some annoying things about Thingiverse | |
// @author Matt Defenthaler | |
// @match http://tampermonkey.net/index.php?version=4.5&ext=dhdg&updated=true | |
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js | |
// @include https://www.thingiverse.com/thing:* | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
var thingGalleryThumbsContainer = $('.thing-gallery-thumbs'); | |
var thingFileImages = $('#thing-files img[src^="https://cdn.thingiverse.com/renders"]'); | |
console.log('thing file images', thingFileImages); | |
$('.thing-thumbs-holder.hidden').removeClass('hidden'); | |
thingFileImages.each(function(i, image) { | |
var imageElem = $(image); | |
var imageSrc = imageElem.attr('src'); | |
var fileName = imageElem.parent('a').attr('data-file-name'); | |
// add title to container row in Thing Files list | |
imageElem.parents('.thing-file').attr('title', fileName); | |
// add title to image in carousel | |
$('img[src="'+imageSrc+'"]', thingGalleryThumbsContainer).attr('title', fileName); | |
}); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment