Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Extensions/pokes.css
Original file line number Diff line number Diff line change
Expand Up @@ -148,10 +148,10 @@
font-family: pokepixelplus, monospace;
font-weight: 500;
font-size: 28px;
line-height: 38px;
}
.nickname::before {
content: "\EA27";
font-family: "tumblr-icons";
content: url("data:image/svg+xml,%3Csvg height='38px' xmlns='http://www.w3.org/2000/svg' viewBox='0 -178 1000 1356'%3E%3Cpath d='M358 703l-88 30 29-89 267-266 59 59zm267-384l-59-59-340 339-88 266 265-89 339-339zm235-59L742 142q-12-12-29-12t-30 12l-60 61 177 176 60-60q12-12 12-29.5T860 260z'/%3E%3C/svg%3E");
float: left;
}
.species {
Expand Down
10 changes: 7 additions & 3 deletions Extensions/pokes.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//* TITLE Pokés **//
//* VERSION 0.12.0 **//
//* VERSION 0.12.1 **//
//* DESCRIPTION Gotta catch them all! **//
//* DETAILS Randomly spawns Pokémon on your dash for you to collect. **//
//* DEVELOPER new-xkit **//
Expand All @@ -10,6 +10,7 @@
XKit.extensions.pokes = {
running: false,
pokedex_url: "https://new-xkit.github.io/XKit/Extensions/dist/page/pokedex.json",
selector: "",

preferences: {
"allow_fullwidth": {
Expand Down Expand Up @@ -40,6 +41,8 @@ XKit.extensions.pokes = {
run: function() {
if (!window.location.href.match(/www.tumblr.com/)) return;
this.running = true;
const post_selector = XKit.page.react ? "[data-id] article" : ".post_avatar";
this.selector = `${post_selector}:not(.poked):not(.unpokable)`;
XKit.tools.init_css('pokes');
XKit.post_listener.add('pokes', XKit.extensions.pokes.checkEligibility);
XKit.extensions.pokes.checkEligibility();
Expand Down Expand Up @@ -73,7 +76,7 @@ XKit.extensions.pokes = {
},

checkEligibility: function() {
$(".post_avatar:not(.poked):not(.unpokable)").each(function() {
$(XKit.extensions.pokes.selector).each(function() {
if (XKit.extensions.pokes.chanceGen()) {
$(this).addClass("poked");
} else {
Expand Down Expand Up @@ -144,7 +147,7 @@ XKit.extensions.pokes = {
'</div>';
}

pokedThing.after(poke_html);
XKit.page.react ? pokedThing.prepend(poke_html) : pokedThing.after(poke_html);
pokedThing.parent().find(".poke").click(function(event) {
if (XKit.storage.get("pokes", "pokemon_storage", "") === "") {
XKit.storage.set("pokes", "pokemon_storage", "[]");
Expand Down Expand Up @@ -332,6 +335,7 @@ XKit.extensions.pokes = {
}
});
});
$(".xkit-pokes-pc-info .nickname-textbox").keydown(event => event.stopPropagation());
$(".xkit-pokes-pc-info .release_pokemon").click(function() {
var pokename = $("div.active").attr("data-pokespecies");
if (typeof $("div.active").attr("data-pokenick") !== "undefined" && $("div.active").attr("data-pokenick")) {
Expand Down
2 changes: 0 additions & 2 deletions Extensions/xkit_preferences.css
Original file line number Diff line number Diff line change
Expand Up @@ -1501,7 +1501,6 @@
.xkit--react .xkit-extension[data-extension-id="old_stats"],
.xkit--react .xkit-extension[data-extension-id="one_click_reply"],
.xkit--react .xkit-extension[data-extension-id="outbox"],
.xkit--react .xkit-extension[data-extension-id="pokes"],
.xkit--react .xkit-extension[data-extension-id="postarchive"],
.xkit--react .xkit-extension[data-extension-id="post_crushes"],
.xkit--react .xkit-extension[data-extension-id="post_limit_checker"],
Expand Down Expand Up @@ -1566,7 +1565,6 @@
.xkit--react #xkit-gallery-extension-old_stats,
.xkit--react #xkit-gallery-extension-one_click_reply,
.xkit--react #xkit-gallery-extension-outbox,
.xkit--react #xkit-gallery-extension-pokes,
.xkit--react #xkit-gallery-extension-postarchive,
.xkit--react #xkit-gallery-extension-post_crushes,
.xkit--react #xkit-gallery-extension-post_limit_checker,
Expand Down
2 changes: 1 addition & 1 deletion Extensions/xkit_preferences.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//* TITLE XKit Preferences **//
//* VERSION 7.6.18 **//
//* VERSION 7.6.19 **//
//* DESCRIPTION Lets you customize XKit **//
//* DEVELOPER new-xkit **//

Expand Down