Skip to content

Instantly share code, notes, and snippets.

@PullJosh
Forked from an-OK-squirrel/packager.user.js
Last active April 14, 2022 13:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PullJosh/5df2d94d9904a43b13ce to your computer and use it in GitHub Desktop.
Save PullJosh/5df2d94d9904a43b13ce to your computer and use it in GitHub Desktop.
packager for scratch
// ==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;");
}
};
@PullJosh
Copy link
Author

Updated for better resizing (original was 64 x 64, so 16px will look better than 15 because math) and for proper vertical alignment.

@Kingzwaztaken
Copy link

How does this work?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment