Skip to content

Instantly share code, notes, and snippets.

View marcustyphoon's full-sized avatar

marcustyphoon

  • 07:18 (UTC -07:00)
View GitHub Profile
@marcustyphoon
marcustyphoon / hide_where_were_we.js
Last active August 10, 2020 22:42
to add to tweaks, presumably, once it's not... a large unorganized pile of things
//* TITLE hide-where-were-we **//
//* VERSION 1.0.0 **//
//* DESCRIPTION **//
//* DEVELOPER New-XKit **//
//* FRAME false **//
//* BETA false **//
XKit.extensions.hide_where_were_we = new Object({
running: false,
@marcustyphoon
marcustyphoon / tumblr css map.json
Last active August 21, 2020 22:10
await window.tumblr.getCssMap() - from whenever I last uploaded this. obviously not json but I wanted the github highlighting
about: ["oGTCg"]
aboutGraphic: ["_3HgS0"]
aboutLink: ["_3zfNN"]
aboutLinks: ["_2qXna"]
aboveOverlays: ["_2170f"]
acceptButton: ["aCfLi"]
acceptButtonWrapper: ["J7xHN"]
accountBlogItem: ["_1L5Rq"]
accountStats: ["_1A8vn"]
action: ["_1MBS5"]
@marcustyphoon
marcustyphoon / becca_css_map.js
Last active August 12, 2020 07:26
XKit extension for developers to insert unmapped css class names all over the react dash. Credit: beccasafan
//* TITLE becca_css_map **//
//* VERSION 1.0.0 **//
//* DESCRIPTION **//
//* DEVELOPER beccasafan, mostly **//
//* FRAME false **//
//* BETA false **//
XKit.extensions.becca_css_map = new Object({
running: false,
@marcustyphoon
marcustyphoon / modal show originals.js
Created August 10, 2020 22:41
code for a dropdown selector for show originals' hidden posts that I probably won't use
mode: {
text: "Hidden post appearance",
default: "default",
value: "default",
type: "combo",
values: [
'"david ↻ staff"', "default",
/* '"david ↻ staff" (with link)', "link", */
'"hidden reblog"', "generic",
"nothing (may break post loading)", "none"
tag tracking icon:
<svg viewBox="0 0 18 18" width="18" height="18" xmlns="http://www.w3.org/2000/svg"><path d="M 0 0 L 0 8 L 11 18 L 18 10 L 8 0 L 0 0 z M 3.5 2 A 1.5 1.5 0 0 1 5 3.5 A 1.5 1.5 0 0 1 3.5 5 A 1.5 1.5 0 0 1 2 3.5 A 1.5 1.5 0 0 1 3.5 2 z "></path></svg>
quick tags icon grey (123, 123, 123):
<svg viewBox="0 0 20 20" height="20" width="20" xmlns="http://www.w3.org/2000/svg"><path d="m1.3 1.3v7.8l11 9.8 6.9-7.8-9.8-9.8z" fill="none" stroke="#7b7b7b" stroke-linejoin="round" stroke-width="1.9"/><circle cx="4.8" cy="4.8" fill="#7b7b7b" r="1.6"/></svg>
quick tags icon green 6BA52A:
<svg viewBox="0 0 20 20" height="20" width="20" xmlns="http://www.w3.org/2000/svg"><path d="m1.3 1.3v7.8l11 9.8 6.9-7.8-9.8-9.8z" fill="none" stroke="#6BA52A" stroke-linejoin="round" stroke-width="1.9"/><circle cx="4.8" cy="4.8" fill="#6BA52A" r="1.6"/></svg>
//combines checking for show originals, no recommended, mute, postblock, and (disable gifs but I doubt anyone uses that setting lol)
//one post_props call per post; unified css
//your extension (example code obviously)
switch (this.preferences.hide_mode) {
case "fancy":
XKit.interface.react.post_hider.add("yourExtension", checkPost, getLabel, true);
break;
XKit.extensions.my_extension = new Object({
variable: 0,
do_something: function () {/* etc */},
//have to do this with e.g. $(selector).each() because we need the "this" keyword
this_should_work: function () {
something_happens.then(inner_function);
},
inner_function: function() {
/**
* Preserves the user's scroll location while running a function that modifies post heights in
* real time.
*
* This is done by choosing a point on the screen, picking the nearest post, and restoring
* the position of that post relative to that point, even if it becomes collapsed.
*
* Supplying the element the user clicked to trigger height modification is recommended, as the
* closest post to where they clicked is probably what they expect to stay stationary. If not,
* the center of the viewport is used.
//* TITLE test_sidebar **//
//* VERSION 1.0.0 **//
//* DESCRIPTION **//
//* DEVELOPER New-XKit **//
//* FRAME false **//
//* BETA true **//
XKit.extensions.test_sidebar = new Object({
running: false,
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.