Skip to content

Commit

Permalink
v7.9.2: Fix XKit Patches on any future versions (#2166)
Browse files Browse the repository at this point in the history
  • Loading branch information
marcustyphoon authored Dec 1, 2024
1 parent 550c954 commit 795f93e
Showing 1 changed file with 33 additions and 33 deletions.
66 changes: 33 additions & 33 deletions Extensions/xkit_patches.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//* TITLE XKit Patches **//
//* VERSION 7.4.22 **//
//* VERSION 7.4.23 **//
//* DESCRIPTION Patches framework **//
//* DEVELOPER new-xkit **//

Expand All @@ -10,11 +10,13 @@ XKit.extensions.xkit_patches = new Object({
run: function() {
this.running = true;

this.run_order.filter(x => {
return this.run_order.indexOf(x) >= this.run_order.indexOf(XKit.version);
}).forEach(x => {
this.patches[x]();
});
if (this.run_order.includes(XKit.version)) {
this.run_order.filter(x => {
return this.run_order.indexOf(x) >= this.run_order.indexOf(XKit.version);
}).forEach(x => {
this.patches[x] && this.patches[x]();
});
}

if (XKit.browser().firefox === true && XKit.storage.get("xkit_patches", "w_edition_warned") !== "true") {
let version = XKit.tools.parse_version(XKit.version);
Expand Down Expand Up @@ -179,10 +181,10 @@ XKit.extensions.xkit_patches = new Object({
}, 1000);
},

run_order: ["7.8.1", "7.8.2", "7.9.0", "7.9.1", "7.9.2", "7.10.0"],
run_order: ["7.8.1", "7.8.2", "7.9.0", "7.9.1", "7.9.2"],

patches: {
"7.10.0": function() {
"7.9.2": function() {

/**
* Given a list of different collections in `items`, return all
Expand Down Expand Up @@ -468,29 +470,29 @@ XKit.extensions.xkit_patches = new Object({
* @returns {Promise<object>}
*/
XKit.interface.mass_edit = function(post_ids, config) {
const path = {
"add": "add_tags_to_posts",
"remove": "remove_tags_from_posts",
"delete": "delete_posts"
}[config.mode];

let payload = {
"post_ids": post_ids.join(","),
"form_key": XKit.interface.form_key()
};

if (config.mode !== "delete") {
payload.tags = config.tags.join(",");
}

return XKit.tools.Nx_XHR({
method: "POST",
url: `https://www.tumblr.com/${path}`,
headers: {
"Content-Type": "application/x-www-form-urlencoded; charset=UTF-8"
},
data: $.param(payload)
});
const path = {
"add": "add_tags_to_posts",
"remove": "remove_tags_from_posts",
"delete": "delete_posts"
}[config.mode];

let payload = {
"post_ids": post_ids.join(","),
"form_key": XKit.interface.form_key()
};

if (config.mode !== "delete") {
payload.tags = config.tags.join(",");
}

return XKit.tools.Nx_XHR({
method: "POST",
url: `https://www.tumblr.com/${path}`,
headers: {
"Content-Type": "application/x-www-form-urlencoded; charset=UTF-8"
},
data: $.param(payload)
});
};

// Override "Search Page Brick Post Fix" from xkit.css
Expand Down Expand Up @@ -1276,8 +1278,6 @@ XKit.extensions.xkit_patches = new Object({
};
},

"7.9.2": function() {},

"7.9.1": function() {},

"7.9.0": function() {},
Expand Down

0 comments on commit 795f93e

Please sign in to comment.