-
-
Save PullJosh/5df2d94d9904a43b13ce to your computer and use it in GitHub Desktop.
packager for scratch
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 Package | |
// @description turns :P into :package: | |
// @namespace scratch_userscripts | |
// @include https://scratch.mit.edu/* | |
// ==/UserScript== | |
x = $("img"); | |
for (var i = $("img").length - 1; i >= 0; i--) { | |
var imageToChange = $($("img")[i]) | |
if (imageToChange.attr("src").endsWith("tongue.png")) { | |
imageToChange.attr("src", "https://gitter.im/_s/l/images/emoji/package.png") | |
imageToChange.attr("width", "16px"); | |
imageToChange.attr("height", "16px"); | |
imageToChange.attr("style", "vertical-align:middle;position:relative;bottom:2px;"); | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Updated for better resizing (original was 64 x 64, so 16px will look better than 15 because math) and for proper vertical alignment.